Prevent getSaveFields from returning a property named undefined

Change-Id: Id7326ee8b951ba2219d3ea6767370ece9aba3c23
This commit is contained in:
Rob Moen 2013-12-18 15:32:49 -08:00
parent 1cd761dad8
commit 212e5b231b

View file

@ -817,7 +817,7 @@ ve.init.mw.ViewPageTarget.prototype.getSaveFields = function () {
var $this = $( this );
// We can't just use $this.val() because .val() always returns the value attribute of
// a checkbox even when it's unchecked
if ( $this.prop( 'type' ) !== 'checkbox' || $this.prop( 'checked' ) ) {
if ( $this.prop ( 'name' ) && ( $this.prop( 'type' ) !== 'checkbox' || $this.prop( 'checked' ) ) ) {
fields[$this.prop( 'name' )] = $this.val();
}
} );