merge from dev

This commit is contained in:
Luke Pulverenti 2015-12-14 10:43:03 -05:00
parent 1c8f02ce0f
commit 33b01d778c
911 changed files with 34157 additions and 57125 deletions

View file

@ -56,7 +56,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/* Overriden from Polymer.IronFormElementBehavior */
value: {
type: String,
value: ''
value: 'on',
observer: '_valueChanged'
}
},
@ -64,6 +65,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
'_requiredChanged(required)'
],
created: function() {
// Used by `iron-form` to handle the case that an element with this behavior
// doesn't have a role of 'checkbox' or 'radio', but should still only be
// included when the form is serialized if `this.checked === true`.
this._hasIronCheckedElementBehavior = true;
},
/**
* Returns false if the element is required and not checked, and true otherwise.
* @return {boolean} true if `required` is false, or if `required` and `checked` are both true.
@ -84,15 +92,20 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
/**
* Update the element's value when checked.
* Fire `iron-changed` when the checked state changes.
*/
_checkedChanged: function() {
this.active = this.checked;
// Unless the user has specified a value, a checked element has the
// default value "on" when checked.
if (this.value === '')
this.value = this.checked ? 'on' : '';
this.fire('iron-change');
},
/**
* Reset value to 'on' if it is set to `undefined`.
*/
_valueChanged: function() {
if (this.value === undefined || this.value === null) {
this.value = 'on';
}
}
};