diff --git a/build/button-core/button-core-coverage.js b/build/button-core/button-core-coverage.js
index 5b8f01824d7..bbbadd379d2 100644
--- a/build/button-core/button-core-coverage.js
+++ b/build/button-core/button-core-coverage.js
@@ -1,6 +1,6 @@
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/button-core/button-core.js']) {
- __coverage__['build/button-core/button-core.js'] = {"path":"build/button-core/button-core.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":42}}},"2":{"name":"ButtonCore","line":19,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":28}}},"3":{"name":"(anonymous_3)","line":48,"loc":{"start":{"line":48,"column":17},"end":{"line":48,"column":34}}},"4":{"name":"(anonymous_4)","line":60,"loc":{"start":{"line":60,"column":15},"end":{"line":60,"column":32}}},"5":{"name":"(anonymous_5)","line":74,"loc":{"start":{"line":74,"column":21},"end":{"line":74,"column":38}}},"6":{"name":"(anonymous_6)","line":88,"loc":{"start":{"line":88,"column":15},"end":{"line":88,"column":26}}},"7":{"name":"(anonymous_7)","line":105,"loc":{"start":{"line":105,"column":12},"end":{"line":105,"column":23}}},"8":{"name":"(anonymous_8)","line":114,"loc":{"start":{"line":114,"column":13},"end":{"line":114,"column":24}}},"9":{"name":"(anonymous_9)","line":123,"loc":{"start":{"line":123,"column":13},"end":{"line":123,"column":24}}},"10":{"name":"(anonymous_10)","line":132,"loc":{"start":{"line":132,"column":15},"end":{"line":132,"column":27}}},"11":{"name":"(anonymous_11)","line":153,"loc":{"start":{"line":153,"column":17},"end":{"line":153,"column":34}}},"12":{"name":"(anonymous_12)","line":172,"loc":{"start":{"line":172,"column":20},"end":{"line":172,"column":36}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":274,"column":83}},"2":{"start":{"line":9,"column":0},"end":{"line":9,"column":51}},"3":{"start":{"line":19,"column":0},"end":{"line":21,"column":1}},"4":{"start":{"line":20,"column":4},"end":{"line":20,"column":29}},"5":{"start":{"line":23,"column":0},"end":{"line":180,"column":2}},"6":{"start":{"line":49,"column":8},"end":{"line":49,"column":31}},"7":{"start":{"line":50,"column":8},"end":{"line":50,"column":37}},"8":{"start":{"line":51,"column":8},"end":{"line":51,"column":31}},"9":{"start":{"line":61,"column":8},"end":{"line":65,"column":9}},"10":{"start":{"line":62,"column":12},"end":{"line":62,"column":44}},"11":{"start":{"line":64,"column":12},"end":{"line":64,"column":54}},"12":{"start":{"line":75,"column":8},"end":{"line":76,"column":72}},"13":{"start":{"line":78,"column":8},"end":{"line":78,"column":60}},"14":{"start":{"line":79,"column":8},"end":{"line":79,"column":61}},"15":{"start":{"line":89,"column":8},"end":{"line":90,"column":56}},"16":{"start":{"line":93,"column":8},"end":{"line":93,"column":53}},"17":{"start":{"line":95,"column":8},"end":{"line":97,"column":9}},"18":{"start":{"line":96,"column":12},"end":{"line":96,"column":39}},"19":{"start":{"line":106,"column":8},"end":{"line":106,"column":36}},"20":{"start":{"line":115,"column":8},"end":{"line":115,"column":35}},"21":{"start":{"line":124,"column":8},"end":{"line":124,"column":26}},"22":{"start":{"line":133,"column":8},"end":{"line":135,"column":18}},"23":{"start":{"line":137,"column":8},"end":{"line":142,"column":9}},"24":{"start":{"line":138,"column":12},"end":{"line":138,"column":38}},"25":{"start":{"line":141,"column":12},"end":{"line":141,"column":87}},"26":{"start":{"line":144,"column":8},"end":{"line":144,"column":21}},"27":{"start":{"line":154,"column":8},"end":{"line":155,"column":56}},"28":{"start":{"line":157,"column":8},"end":{"line":161,"column":9}},"29":{"start":{"line":158,"column":12},"end":{"line":158,"column":37}},"30":{"start":{"line":160,"column":12},"end":{"line":160,"column":86}},"31":{"start":{"line":163,"column":8},"end":{"line":163,"column":21}},"32":{"start":{"line":173,"column":8},"end":{"line":173,"column":34}},"33":{"start":{"line":175,"column":8},"end":{"line":175,"column":43}},"34":{"start":{"line":176,"column":8},"end":{"line":176,"column":65}},"35":{"start":{"line":178,"column":8},"end":{"line":178,"column":21}},"36":{"start":{"line":183,"column":0},"end":{"line":183,"column":55}},"37":{"start":{"line":193,"column":0},"end":{"line":218,"column":2}},"38":{"start":{"line":227,"column":0},"end":{"line":227,"column":27}},"39":{"start":{"line":237,"column":0},"end":{"line":242,"column":2}},"40":{"start":{"line":252,"column":0},"end":{"line":255,"column":2}},"41":{"start":{"line":265,"column":0},"end":{"line":269,"column":2}},"42":{"start":{"line":272,"column":0},"end":{"line":272,"column":26}}},"branchMap":{"1":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":8},"end":{"line":61,"column":8}},{"start":{"line":61,"column":8},"end":{"line":61,"column":8}}]},"2":{"line":76,"type":"binary-expr","locations":[{"start":{"line":76,"column":19},"end":{"line":76,"column":63}},{"start":{"line":76,"column":67},"end":{"line":76,"column":71}}]},"3":{"line":78,"type":"binary-expr","locations":[{"start":{"line":78,"column":23},"end":{"line":78,"column":35}},{"start":{"line":78,"column":39},"end":{"line":78,"column":59}}]},"4":{"line":95,"type":"if","locations":[{"start":{"line":95,"column":8},"end":{"line":95,"column":8}},{"start":{"line":95,"column":8},"end":{"line":95,"column":8}}]},"5":{"line":95,"type":"binary-expr","locations":[{"start":{"line":95,"column":12},"end":{"line":95,"column":32}},{"start":{"line":95,"column":36},"end":{"line":95,"column":55}}]},"6":{"line":137,"type":"if","locations":[{"start":{"line":137,"column":8},"end":{"line":137,"column":8}},{"start":{"line":137,"column":8},"end":{"line":137,"column":8}}]},"7":{"line":141,"type":"binary-expr","locations":[{"start":{"line":141,"column":21},"end":{"line":141,"column":65}},{"start":{"line":141,"column":69},"end":{"line":141,"column":73}}]},"8":{"line":157,"type":"if","locations":[{"start":{"line":157,"column":8},"end":{"line":157,"column":8}},{"start":{"line":157,"column":8},"end":{"line":157,"column":8}}]},"9":{"line":160,"type":"binary-expr","locations":[{"start":{"line":160,"column":13},"end":{"line":160,"column":57}},{"start":{"line":160,"column":61},"end":{"line":160,"column":65}}]}},"code":["(function () { YUI.add('button-core', function (Y, NAME) {","","/**"," * Provides an interface for working with button-like DOM nodes"," *"," * @module button-core"," * @since 3.5.0"," */","var getClassName = Y.ClassNameManager.getClassName;","","/**"," * Creates a button"," *"," * @class ButtonCore"," * @uses AttributeCore"," * @param config {Object} Configuration object"," * @constructor"," */","function ButtonCore(config) {"," this.initializer(config);","}","","ButtonCore.prototype = {",""," /**"," *"," * @property TEMPLATE"," * @type {String}"," * @default "," */"," TEMPLATE: '',",""," /**"," *"," * @property constructor"," * @type {Object}"," * @default ButtonCore"," * @private"," */"," constructor: ButtonCore,",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this._initNode(config);"," this._initAttributes(config);"," this._renderUI(config);"," },",""," /**"," * @method _initNode"," * @description Node initializer"," * @param config {Object} Config object."," * @private"," */"," _initNode: function(config) {"," if (config.host) {"," this._host = Y.one(config.host);"," } else {"," this._host = Y.Node.create(this.TEMPLATE);"," }"," },",""," /**"," * @method _initAttributes"," * @description Attribute initializer"," * @param config {Object} Config object."," * @private"," */"," _initAttributes: function(config) {"," var host = this._host,"," node = host.one('.' + ButtonCore.CLASS_NAMES.LABEL) || host;"," "," config.label = config.label || this._getLabel(node);"," Y.AttributeCore.call(this, ButtonCore.ATTRS, config);"," },",""," /**"," * @method renderUI"," * @description Renders any UI/DOM elements for Button instances"," * @param config {Object} Config object."," * @private"," */"," _renderUI: function() {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase();",""," // Set some default node attributes"," node.addClass(ButtonCore.CLASS_NAMES.BUTTON);"," "," if (tagName !== 'button' && tagName !== 'input') {"," node.set('role', 'button');"," }"," },",""," /**"," * @method enable"," * @description Sets the button's `disabled` DOM attribute to false"," * @public"," */"," enable: function() {"," this.set('disabled', false);"," },",""," /**"," * @method disable"," * @description Sets the button's `disabled` DOM attribute to true"," * @public"," */"," disable: function() {"," this.set('disabled', true);"," },",""," /**"," * @method getNode"," * @description Gets the host DOM node for this button instance"," * @public"," */"," getNode: function() {"," return this._host;"," },"," "," /**"," * @method _getLabel"," * @description Getter for a button's 'label' ATTR"," * @private"," */"," _getLabel: function () {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase(),"," label;",""," if (tagName === 'input') {"," label = node.get('value');"," }"," else {"," label = (node.one('.' + ButtonCore.CLASS_NAMES.LABEL) || node).get('text');"," }"," "," return label;"," },"," "," /**"," * @method _uiSetLabel"," * @description Setter for a button's 'label' ATTR"," * @param label {string}"," * @private"," */"," _uiSetLabel: function (label) {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase();",""," if (tagName === 'input') {"," node.set('value', label);"," } else {"," (node.one('.' + ButtonCore.CLASS_NAMES.LABEL) || node).set('text', label);"," }",""," return label;"," },",""," /**"," * @method _uiSetDisabled"," * @description Setter for the 'disabled' ATTR"," * @param value {boolean}"," * @private"," */"," _uiSetDisabled: function(value) {"," var node = this.getNode();"," "," node.getDOMNode().disabled = value; // avoid rerunning setter when this === node"," node.toggleClass(ButtonCore.CLASS_NAMES.DISABLED, value);"," "," return value;"," }","};","","","Y.mix(ButtonCore.prototype, Y.AttributeCore.prototype);","","/**"," * Attribute configuration."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */","ButtonCore.ATTRS = {",""," /**"," * The text of the button (the `value` or `text` property)"," *"," * @attribute label"," * @type String"," */"," label: {"," setter: '_uiSetLabel',"," getter: '_getLabel',"," lazyAdd: false"," },",""," /**"," * The button's enabled/disabled state"," *"," * @attribute disabled"," * @type Boolean"," */"," disabled: {"," value: false,"," setter: '_uiSetDisabled',"," lazyAdd: false"," }","};","","/**"," * Name of this component."," *"," * @property NAME"," * @type String"," * @static"," */","ButtonCore.NAME = \"button\";","","/**"," * Array of static constants used to identify the classnames applied to DOM nodes"," *"," * @property CLASS_NAMES"," * @type {Object}"," * @public"," * @static"," */","ButtonCore.CLASS_NAMES = {"," BUTTON : getClassName('button'),"," DISABLED: getClassName('button', 'disabled'),"," SELECTED: getClassName('button', 'selected'),"," LABEL : getClassName('button', 'label')","};","","/**"," * Array of static constants used to for applying ARIA states"," *"," * @property CLASS_NAMES"," * @type {Object}"," * @private"," * @static"," */","ButtonCore.ARIA_STATES = {"," PRESSED : 'aria-pressed',"," CHECKED : 'aria-checked'","};","","/**"," * Array of static constants used to for applying ARIA roles"," *"," * @property CLASS_NAMES"," * @type {Object}"," * @private"," * @static"," */","ButtonCore.ARIA_ROLES = {"," BUTTON : 'button',"," CHECKBOX: 'checkbox',"," TOGGLE : 'toggle'","};","","// Export Button","Y.ButtonCore = ButtonCore;","","}, '@VERSION@', {\"requires\": [\"attribute-core\", \"classnamemanager\", \"node-base\"]});","","}());"]};
+ __coverage__['build/button-core/button-core.js'] = {"path":"build/button-core/button-core.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":42}}},"2":{"name":"ButtonCore","line":19,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":28}}},"3":{"name":"(anonymous_3)","line":48,"loc":{"start":{"line":48,"column":17},"end":{"line":48,"column":34}}},"4":{"name":"(anonymous_4)","line":60,"loc":{"start":{"line":60,"column":15},"end":{"line":60,"column":32}}},"5":{"name":"(anonymous_5)","line":74,"loc":{"start":{"line":74,"column":21},"end":{"line":74,"column":38}}},"6":{"name":"(anonymous_6)","line":84,"loc":{"start":{"line":84,"column":15},"end":{"line":84,"column":26}}},"7":{"name":"(anonymous_7)","line":101,"loc":{"start":{"line":101,"column":12},"end":{"line":101,"column":23}}},"8":{"name":"(anonymous_8)","line":110,"loc":{"start":{"line":110,"column":13},"end":{"line":110,"column":24}}},"9":{"name":"(anonymous_9)","line":119,"loc":{"start":{"line":119,"column":13},"end":{"line":119,"column":24}}},"10":{"name":"(anonymous_10)","line":128,"loc":{"start":{"line":128,"column":15},"end":{"line":128,"column":27}}},"11":{"name":"(anonymous_11)","line":141,"loc":{"start":{"line":141,"column":23},"end":{"line":141,"column":39}}},"12":{"name":"(anonymous_12)","line":161,"loc":{"start":{"line":161,"column":17},"end":{"line":161,"column":34}}},"13":{"name":"(anonymous_13)","line":180,"loc":{"start":{"line":180,"column":20},"end":{"line":180,"column":36}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":284,"column":83}},"2":{"start":{"line":9,"column":0},"end":{"line":9,"column":51}},"3":{"start":{"line":19,"column":0},"end":{"line":21,"column":1}},"4":{"start":{"line":20,"column":4},"end":{"line":20,"column":29}},"5":{"start":{"line":23,"column":0},"end":{"line":188,"column":2}},"6":{"start":{"line":49,"column":8},"end":{"line":49,"column":31}},"7":{"start":{"line":50,"column":8},"end":{"line":50,"column":37}},"8":{"start":{"line":51,"column":8},"end":{"line":51,"column":31}},"9":{"start":{"line":61,"column":8},"end":{"line":65,"column":9}},"10":{"start":{"line":62,"column":12},"end":{"line":62,"column":44}},"11":{"start":{"line":64,"column":12},"end":{"line":64,"column":54}},"12":{"start":{"line":75,"column":8},"end":{"line":75,"column":61}},"13":{"start":{"line":85,"column":8},"end":{"line":86,"column":56}},"14":{"start":{"line":89,"column":8},"end":{"line":89,"column":53}},"15":{"start":{"line":91,"column":8},"end":{"line":93,"column":9}},"16":{"start":{"line":92,"column":12},"end":{"line":92,"column":39}},"17":{"start":{"line":102,"column":8},"end":{"line":102,"column":36}},"18":{"start":{"line":111,"column":8},"end":{"line":111,"column":35}},"19":{"start":{"line":120,"column":8},"end":{"line":120,"column":26}},"20":{"start":{"line":129,"column":8},"end":{"line":129,"column":34}},"21":{"start":{"line":131,"column":8},"end":{"line":131,"column":44}},"22":{"start":{"line":142,"column":8},"end":{"line":143,"column":18}},"23":{"start":{"line":145,"column":8},"end":{"line":150,"column":9}},"24":{"start":{"line":146,"column":12},"end":{"line":146,"column":38}},"25":{"start":{"line":149,"column":12},"end":{"line":149,"column":85}},"26":{"start":{"line":152,"column":8},"end":{"line":152,"column":21}},"27":{"start":{"line":162,"column":8},"end":{"line":163,"column":56}},"28":{"start":{"line":165,"column":8},"end":{"line":169,"column":9}},"29":{"start":{"line":166,"column":12},"end":{"line":166,"column":37}},"30":{"start":{"line":168,"column":12},"end":{"line":168,"column":82}},"31":{"start":{"line":171,"column":8},"end":{"line":171,"column":21}},"32":{"start":{"line":181,"column":8},"end":{"line":181,"column":34}},"33":{"start":{"line":183,"column":8},"end":{"line":183,"column":43}},"34":{"start":{"line":184,"column":8},"end":{"line":184,"column":65}},"35":{"start":{"line":186,"column":8},"end":{"line":186,"column":21}},"36":{"start":{"line":191,"column":0},"end":{"line":191,"column":55}},"37":{"start":{"line":201,"column":0},"end":{"line":227,"column":2}},"38":{"start":{"line":236,"column":0},"end":{"line":236,"column":27}},"39":{"start":{"line":246,"column":0},"end":{"line":251,"column":2}},"40":{"start":{"line":261,"column":0},"end":{"line":264,"column":2}},"41":{"start":{"line":274,"column":0},"end":{"line":278,"column":2}},"42":{"start":{"line":281,"column":0},"end":{"line":281,"column":26}}},"branchMap":{"1":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":8},"end":{"line":61,"column":8}},{"start":{"line":61,"column":8},"end":{"line":61,"column":8}}]},"2":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":8},"end":{"line":91,"column":8}},{"start":{"line":91,"column":8},"end":{"line":91,"column":8}}]},"3":{"line":91,"type":"binary-expr","locations":[{"start":{"line":91,"column":12},"end":{"line":91,"column":32}},{"start":{"line":91,"column":36},"end":{"line":91,"column":55}}]},"4":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":8},"end":{"line":145,"column":8}},{"start":{"line":145,"column":8},"end":{"line":145,"column":8}}]},"5":{"line":149,"type":"binary-expr","locations":[{"start":{"line":149,"column":21},"end":{"line":149,"column":65}},{"start":{"line":149,"column":69},"end":{"line":149,"column":73}}]},"6":{"line":165,"type":"if","locations":[{"start":{"line":165,"column":8},"end":{"line":165,"column":8}},{"start":{"line":165,"column":8},"end":{"line":165,"column":8}}]},"7":{"line":168,"type":"binary-expr","locations":[{"start":{"line":168,"column":13},"end":{"line":168,"column":57}},{"start":{"line":168,"column":61},"end":{"line":168,"column":65}}]}},"code":["(function () { YUI.add('button-core', function (Y, NAME) {","","/**"," * Provides an interface for working with button-like DOM nodes"," *"," * @module button-core"," * @since 3.5.0"," */","var getClassName = Y.ClassNameManager.getClassName;","","/**"," * Creates a button"," *"," * @class ButtonCore"," * @uses AttributeCore"," * @param config {Object} Configuration object"," * @constructor"," */","function ButtonCore(config) {"," this.initializer(config);","}","","ButtonCore.prototype = {",""," /**"," *"," * @property TEMPLATE"," * @type {String}"," * @default "," */"," TEMPLATE: '',",""," /**"," *"," * @property constructor"," * @type {Object}"," * @default ButtonCore"," * @private"," */"," constructor: ButtonCore,",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this._initNode(config);"," this._initAttributes(config);"," this._renderUI(config);"," },",""," /**"," * @method _initNode"," * @description Node initializer"," * @param config {Object} Config object."," * @private"," */"," _initNode: function(config) {"," if (config.host) {"," this._host = Y.one(config.host);"," } else {"," this._host = Y.Node.create(this.TEMPLATE);"," }"," },",""," /**"," * @method _initAttributes"," * @description Attribute initializer"," * @param config {Object} Config object."," * @private"," */"," _initAttributes: function(config) {"," Y.AttributeCore.call(this, ButtonCore.ATTRS, config);"," },",""," /**"," * @method renderUI"," * @description Renders any UI/DOM elements for Button instances"," * @param config {Object} Config object."," * @private"," */"," _renderUI: function() {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase();",""," // Set some default node attributes"," node.addClass(ButtonCore.CLASS_NAMES.BUTTON);",""," if (tagName !== 'button' && tagName !== 'input') {"," node.set('role', 'button');"," }"," },",""," /**"," * @method enable"," * @description Sets the button's `disabled` DOM attribute to false"," * @public"," */"," enable: function() {"," this.set('disabled', false);"," },",""," /**"," * @method disable"," * @description Sets the button's `disabled` DOM attribute to true"," * @public"," */"," disable: function() {"," this.set('disabled', true);"," },",""," /**"," * @method getNode"," * @description Gets the host DOM node for this button instance"," * @public"," */"," getNode: function() {"," return this._host;"," },",""," /**"," * @method _getLabel"," * @description Getter for a button's 'label' ATTR"," * @private"," */"," _getLabel: function () {"," var node = this.getNode();",""," return this._getLabelFromNode(node);"," },",""," /**"," * @method _getLabelFromNode"," * @description Getter for a button's 'label' ATTR"," * @param node {Node} The Y.Node instance to obtain the label from"," * @return {HTML|String} The label for a given node"," * @private"," */"," _getLabelFromNode: function (node) {"," var tagName = node.get('tagName').toLowerCase(),"," label;",""," if (tagName === 'input') {"," label = node.get('value');"," }"," else {"," label = (node.one('.' + ButtonCore.CLASS_NAMES.LABEL) || node).getHTML();"," }",""," return label;"," },",""," /**"," * @method _uiSetLabel"," * @description Setter for a button's 'label' ATTR"," * @param label {HTML|String} The label to set"," * @private"," */"," _uiSetLabel: function (label) {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase();",""," if (tagName === 'input') {"," node.set('value', label);"," } else {"," (node.one('.' + ButtonCore.CLASS_NAMES.LABEL) || node).setHTML(label);"," }",""," return label;"," },",""," /**"," * @method _uiSetDisabled"," * @description Setter for the 'disabled' ATTR"," * @param value {boolean}"," * @private"," */"," _uiSetDisabled: function(value) {"," var node = this.getNode();",""," node.getDOMNode().disabled = value; // avoid rerunning setter when this === node"," node.toggleClass(ButtonCore.CLASS_NAMES.DISABLED, value);",""," return value;"," }","};","","","Y.mix(ButtonCore.prototype, Y.AttributeCore.prototype);","","/**"," * Attribute configuration."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */","ButtonCore.ATTRS = {",""," /**"," * The text of the button (the `value` or `text` property)"," *"," * @attribute label"," * @type {HTML|String}"," */"," label: {"," valueFn: '_getLabel',"," setter: '_uiSetLabel',"," getter: '_getLabel',"," lazyAdd: false"," },",""," /**"," * The button's enabled/disabled state"," *"," * @attribute disabled"," * @type Boolean"," */"," disabled: {"," value: false,"," setter: '_uiSetDisabled',"," lazyAdd: false"," }","};","","/**"," * Name of this component."," *"," * @property NAME"," * @type String"," * @static"," */","ButtonCore.NAME = \"button\";","","/**"," * Array of static constants used to identify the classnames applied to DOM nodes"," *"," * @property CLASS_NAMES"," * @type {Object}"," * @public"," * @static"," */","ButtonCore.CLASS_NAMES = {"," BUTTON : getClassName('button'),"," DISABLED: getClassName('button', 'disabled'),"," SELECTED: getClassName('button', 'selected'),"," LABEL : getClassName('button', 'label')","};","","/**"," * Array of static constants used to for applying ARIA states"," *"," * @property CLASS_NAMES"," * @type {Object}"," * @private"," * @static"," */","ButtonCore.ARIA_STATES = {"," PRESSED : 'aria-pressed',"," CHECKED : 'aria-checked'","};","","/**"," * Array of static constants used to for applying ARIA roles"," *"," * @property CLASS_NAMES"," * @type {Object}"," * @private"," * @static"," */","ButtonCore.ARIA_ROLES = {"," BUTTON : 'button',"," CHECKBOX: 'checkbox',"," TOGGLE : 'toggle'","};","","// Export Button","Y.ButtonCore = ButtonCore;","","","}, '@VERSION@', {\"requires\": [\"attribute-core\", \"classnamemanager\", \"node-base\"]});","","}());"]};
}
var __cov_oaiXFrFXvCNKuifOTFqz5A = __coverage__['build/button-core/button-core.js'];
-__cov_oaiXFrFXvCNKuifOTFqz5A.s['1']++;YUI.add('button-core',function(Y,NAME){__cov_oaiXFrFXvCNKuifOTFqz5A.f['1']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['2']++;var getClassName=Y.ClassNameManager.getClassName;__cov_oaiXFrFXvCNKuifOTFqz5A.s['3']++;function ButtonCore(config){__cov_oaiXFrFXvCNKuifOTFqz5A.f['2']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['4']++;this.initializer(config);}__cov_oaiXFrFXvCNKuifOTFqz5A.s['5']++;ButtonCore.prototype={TEMPLATE:'',constructor:ButtonCore,initializer:function(config){__cov_oaiXFrFXvCNKuifOTFqz5A.f['3']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['6']++;this._initNode(config);__cov_oaiXFrFXvCNKuifOTFqz5A.s['7']++;this._initAttributes(config);__cov_oaiXFrFXvCNKuifOTFqz5A.s['8']++;this._renderUI(config);},_initNode:function(config){__cov_oaiXFrFXvCNKuifOTFqz5A.f['4']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['9']++;if(config.host){__cov_oaiXFrFXvCNKuifOTFqz5A.b['1'][0]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['10']++;this._host=Y.one(config.host);}else{__cov_oaiXFrFXvCNKuifOTFqz5A.b['1'][1]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['11']++;this._host=Y.Node.create(this.TEMPLATE);}},_initAttributes:function(config){__cov_oaiXFrFXvCNKuifOTFqz5A.f['5']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['12']++;var host=this._host,node=(__cov_oaiXFrFXvCNKuifOTFqz5A.b['2'][0]++,host.one('.'+ButtonCore.CLASS_NAMES.LABEL))||(__cov_oaiXFrFXvCNKuifOTFqz5A.b['2'][1]++,host);__cov_oaiXFrFXvCNKuifOTFqz5A.s['13']++;config.label=(__cov_oaiXFrFXvCNKuifOTFqz5A.b['3'][0]++,config.label)||(__cov_oaiXFrFXvCNKuifOTFqz5A.b['3'][1]++,this._getLabel(node));__cov_oaiXFrFXvCNKuifOTFqz5A.s['14']++;Y.AttributeCore.call(this,ButtonCore.ATTRS,config);},_renderUI:function(){__cov_oaiXFrFXvCNKuifOTFqz5A.f['6']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['15']++;var node=this.getNode(),tagName=node.get('tagName').toLowerCase();__cov_oaiXFrFXvCNKuifOTFqz5A.s['16']++;node.addClass(ButtonCore.CLASS_NAMES.BUTTON);__cov_oaiXFrFXvCNKuifOTFqz5A.s['17']++;if((__cov_oaiXFrFXvCNKuifOTFqz5A.b['5'][0]++,tagName!=='button')&&(__cov_oaiXFrFXvCNKuifOTFqz5A.b['5'][1]++,tagName!=='input')){__cov_oaiXFrFXvCNKuifOTFqz5A.b['4'][0]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['18']++;node.set('role','button');}else{__cov_oaiXFrFXvCNKuifOTFqz5A.b['4'][1]++;}},enable:function(){__cov_oaiXFrFXvCNKuifOTFqz5A.f['7']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['19']++;this.set('disabled',false);},disable:function(){__cov_oaiXFrFXvCNKuifOTFqz5A.f['8']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['20']++;this.set('disabled',true);},getNode:function(){__cov_oaiXFrFXvCNKuifOTFqz5A.f['9']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['21']++;return this._host;},_getLabel:function(){__cov_oaiXFrFXvCNKuifOTFqz5A.f['10']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['22']++;var node=this.getNode(),tagName=node.get('tagName').toLowerCase(),label;__cov_oaiXFrFXvCNKuifOTFqz5A.s['23']++;if(tagName==='input'){__cov_oaiXFrFXvCNKuifOTFqz5A.b['6'][0]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['24']++;label=node.get('value');}else{__cov_oaiXFrFXvCNKuifOTFqz5A.b['6'][1]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['25']++;label=((__cov_oaiXFrFXvCNKuifOTFqz5A.b['7'][0]++,node.one('.'+ButtonCore.CLASS_NAMES.LABEL))||(__cov_oaiXFrFXvCNKuifOTFqz5A.b['7'][1]++,node)).get('text');}__cov_oaiXFrFXvCNKuifOTFqz5A.s['26']++;return label;},_uiSetLabel:function(label){__cov_oaiXFrFXvCNKuifOTFqz5A.f['11']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['27']++;var node=this.getNode(),tagName=node.get('tagName').toLowerCase();__cov_oaiXFrFXvCNKuifOTFqz5A.s['28']++;if(tagName==='input'){__cov_oaiXFrFXvCNKuifOTFqz5A.b['8'][0]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['29']++;node.set('value',label);}else{__cov_oaiXFrFXvCNKuifOTFqz5A.b['8'][1]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['30']++;((__cov_oaiXFrFXvCNKuifOTFqz5A.b['9'][0]++,node.one('.'+ButtonCore.CLASS_NAMES.LABEL))||(__cov_oaiXFrFXvCNKuifOTFqz5A.b['9'][1]++,node)).set('text',label);}__cov_oaiXFrFXvCNKuifOTFqz5A.s['31']++;return label;},_uiSetDisabled:function(value){__cov_oaiXFrFXvCNKuifOTFqz5A.f['12']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['32']++;var node=this.getNode();__cov_oaiXFrFXvCNKuifOTFqz5A.s['33']++;node.getDOMNode().disabled=value;__cov_oaiXFrFXvCNKuifOTFqz5A.s['34']++;node.toggleClass(ButtonCore.CLASS_NAMES.DISABLED,value);__cov_oaiXFrFXvCNKuifOTFqz5A.s['35']++;return value;}};__cov_oaiXFrFXvCNKuifOTFqz5A.s['36']++;Y.mix(ButtonCore.prototype,Y.AttributeCore.prototype);__cov_oaiXFrFXvCNKuifOTFqz5A.s['37']++;ButtonCore.ATTRS={label:{setter:'_uiSetLabel',getter:'_getLabel',lazyAdd:false},disabled:{value:false,setter:'_uiSetDisabled',lazyAdd:false}};__cov_oaiXFrFXvCNKuifOTFqz5A.s['38']++;ButtonCore.NAME='button';__cov_oaiXFrFXvCNKuifOTFqz5A.s['39']++;ButtonCore.CLASS_NAMES={BUTTON:getClassName('button'),DISABLED:getClassName('button','disabled'),SELECTED:getClassName('button','selected'),LABEL:getClassName('button','label')};__cov_oaiXFrFXvCNKuifOTFqz5A.s['40']++;ButtonCore.ARIA_STATES={PRESSED:'aria-pressed',CHECKED:'aria-checked'};__cov_oaiXFrFXvCNKuifOTFqz5A.s['41']++;ButtonCore.ARIA_ROLES={BUTTON:'button',CHECKBOX:'checkbox',TOGGLE:'toggle'};__cov_oaiXFrFXvCNKuifOTFqz5A.s['42']++;Y.ButtonCore=ButtonCore;},'@VERSION@',{'requires':['attribute-core','classnamemanager','node-base']});
+__cov_oaiXFrFXvCNKuifOTFqz5A.s['1']++;YUI.add('button-core',function(Y,NAME){__cov_oaiXFrFXvCNKuifOTFqz5A.f['1']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['2']++;var getClassName=Y.ClassNameManager.getClassName;__cov_oaiXFrFXvCNKuifOTFqz5A.s['3']++;function ButtonCore(config){__cov_oaiXFrFXvCNKuifOTFqz5A.f['2']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['4']++;this.initializer(config);}__cov_oaiXFrFXvCNKuifOTFqz5A.s['5']++;ButtonCore.prototype={TEMPLATE:'',constructor:ButtonCore,initializer:function(config){__cov_oaiXFrFXvCNKuifOTFqz5A.f['3']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['6']++;this._initNode(config);__cov_oaiXFrFXvCNKuifOTFqz5A.s['7']++;this._initAttributes(config);__cov_oaiXFrFXvCNKuifOTFqz5A.s['8']++;this._renderUI(config);},_initNode:function(config){__cov_oaiXFrFXvCNKuifOTFqz5A.f['4']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['9']++;if(config.host){__cov_oaiXFrFXvCNKuifOTFqz5A.b['1'][0]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['10']++;this._host=Y.one(config.host);}else{__cov_oaiXFrFXvCNKuifOTFqz5A.b['1'][1]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['11']++;this._host=Y.Node.create(this.TEMPLATE);}},_initAttributes:function(config){__cov_oaiXFrFXvCNKuifOTFqz5A.f['5']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['12']++;Y.AttributeCore.call(this,ButtonCore.ATTRS,config);},_renderUI:function(){__cov_oaiXFrFXvCNKuifOTFqz5A.f['6']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['13']++;var node=this.getNode(),tagName=node.get('tagName').toLowerCase();__cov_oaiXFrFXvCNKuifOTFqz5A.s['14']++;node.addClass(ButtonCore.CLASS_NAMES.BUTTON);__cov_oaiXFrFXvCNKuifOTFqz5A.s['15']++;if((__cov_oaiXFrFXvCNKuifOTFqz5A.b['3'][0]++,tagName!=='button')&&(__cov_oaiXFrFXvCNKuifOTFqz5A.b['3'][1]++,tagName!=='input')){__cov_oaiXFrFXvCNKuifOTFqz5A.b['2'][0]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['16']++;node.set('role','button');}else{__cov_oaiXFrFXvCNKuifOTFqz5A.b['2'][1]++;}},enable:function(){__cov_oaiXFrFXvCNKuifOTFqz5A.f['7']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['17']++;this.set('disabled',false);},disable:function(){__cov_oaiXFrFXvCNKuifOTFqz5A.f['8']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['18']++;this.set('disabled',true);},getNode:function(){__cov_oaiXFrFXvCNKuifOTFqz5A.f['9']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['19']++;return this._host;},_getLabel:function(){__cov_oaiXFrFXvCNKuifOTFqz5A.f['10']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['20']++;var node=this.getNode();__cov_oaiXFrFXvCNKuifOTFqz5A.s['21']++;return this._getLabelFromNode(node);},_getLabelFromNode:function(node){__cov_oaiXFrFXvCNKuifOTFqz5A.f['11']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['22']++;var tagName=node.get('tagName').toLowerCase(),label;__cov_oaiXFrFXvCNKuifOTFqz5A.s['23']++;if(tagName==='input'){__cov_oaiXFrFXvCNKuifOTFqz5A.b['4'][0]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['24']++;label=node.get('value');}else{__cov_oaiXFrFXvCNKuifOTFqz5A.b['4'][1]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['25']++;label=((__cov_oaiXFrFXvCNKuifOTFqz5A.b['5'][0]++,node.one('.'+ButtonCore.CLASS_NAMES.LABEL))||(__cov_oaiXFrFXvCNKuifOTFqz5A.b['5'][1]++,node)).getHTML();}__cov_oaiXFrFXvCNKuifOTFqz5A.s['26']++;return label;},_uiSetLabel:function(label){__cov_oaiXFrFXvCNKuifOTFqz5A.f['12']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['27']++;var node=this.getNode(),tagName=node.get('tagName').toLowerCase();__cov_oaiXFrFXvCNKuifOTFqz5A.s['28']++;if(tagName==='input'){__cov_oaiXFrFXvCNKuifOTFqz5A.b['6'][0]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['29']++;node.set('value',label);}else{__cov_oaiXFrFXvCNKuifOTFqz5A.b['6'][1]++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['30']++;((__cov_oaiXFrFXvCNKuifOTFqz5A.b['7'][0]++,node.one('.'+ButtonCore.CLASS_NAMES.LABEL))||(__cov_oaiXFrFXvCNKuifOTFqz5A.b['7'][1]++,node)).setHTML(label);}__cov_oaiXFrFXvCNKuifOTFqz5A.s['31']++;return label;},_uiSetDisabled:function(value){__cov_oaiXFrFXvCNKuifOTFqz5A.f['13']++;__cov_oaiXFrFXvCNKuifOTFqz5A.s['32']++;var node=this.getNode();__cov_oaiXFrFXvCNKuifOTFqz5A.s['33']++;node.getDOMNode().disabled=value;__cov_oaiXFrFXvCNKuifOTFqz5A.s['34']++;node.toggleClass(ButtonCore.CLASS_NAMES.DISABLED,value);__cov_oaiXFrFXvCNKuifOTFqz5A.s['35']++;return value;}};__cov_oaiXFrFXvCNKuifOTFqz5A.s['36']++;Y.mix(ButtonCore.prototype,Y.AttributeCore.prototype);__cov_oaiXFrFXvCNKuifOTFqz5A.s['37']++;ButtonCore.ATTRS={label:{valueFn:'_getLabel',setter:'_uiSetLabel',getter:'_getLabel',lazyAdd:false},disabled:{value:false,setter:'_uiSetDisabled',lazyAdd:false}};__cov_oaiXFrFXvCNKuifOTFqz5A.s['38']++;ButtonCore.NAME='button';__cov_oaiXFrFXvCNKuifOTFqz5A.s['39']++;ButtonCore.CLASS_NAMES={BUTTON:getClassName('button'),DISABLED:getClassName('button','disabled'),SELECTED:getClassName('button','selected'),LABEL:getClassName('button','label')};__cov_oaiXFrFXvCNKuifOTFqz5A.s['40']++;ButtonCore.ARIA_STATES={PRESSED:'aria-pressed',CHECKED:'aria-checked'};__cov_oaiXFrFXvCNKuifOTFqz5A.s['41']++;ButtonCore.ARIA_ROLES={BUTTON:'button',CHECKBOX:'checkbox',TOGGLE:'toggle'};__cov_oaiXFrFXvCNKuifOTFqz5A.s['42']++;Y.ButtonCore=ButtonCore;},'@VERSION@',{'requires':['attribute-core','classnamemanager','node-base']});
diff --git a/build/button-core/button-core-debug.js b/build/button-core/button-core-debug.js
index f63c3f562df..d9fc9cb6cfe 100644
--- a/build/button-core/button-core-debug.js
+++ b/build/button-core/button-core-debug.js
@@ -72,10 +72,6 @@ ButtonCore.prototype = {
* @private
*/
_initAttributes: function(config) {
- var host = this._host,
- node = host.one('.' + ButtonCore.CLASS_NAMES.LABEL) || host;
-
- config.label = config.label || this._getLabel(node);
Y.AttributeCore.call(this, ButtonCore.ATTRS, config);
},
@@ -91,7 +87,7 @@ ButtonCore.prototype = {
// Set some default node attributes
node.addClass(ButtonCore.CLASS_NAMES.BUTTON);
-
+
if (tagName !== 'button' && tagName !== 'input') {
node.set('role', 'button');
}
@@ -123,31 +119,43 @@ ButtonCore.prototype = {
getNode: function() {
return this._host;
},
-
+
/**
* @method _getLabel
* @description Getter for a button's 'label' ATTR
* @private
*/
_getLabel: function () {
- var node = this.getNode(),
- tagName = node.get('tagName').toLowerCase(),
+ var node = this.getNode();
+
+ return this._getLabelFromNode(node);
+ },
+
+ /**
+ * @method _getLabelFromNode
+ * @description Getter for a button's 'label' ATTR
+ * @param node {Node} The Y.Node instance to obtain the label from
+ * @return {HTML|String} The label for a given node
+ * @private
+ */
+ _getLabelFromNode: function (node) {
+ var tagName = node.get('tagName').toLowerCase(),
label;
if (tagName === 'input') {
label = node.get('value');
}
else {
- label = (node.one('.' + ButtonCore.CLASS_NAMES.LABEL) || node).get('text');
+ label = (node.one('.' + ButtonCore.CLASS_NAMES.LABEL) || node).getHTML();
}
-
+
return label;
},
-
+
/**
* @method _uiSetLabel
* @description Setter for a button's 'label' ATTR
- * @param label {string}
+ * @param label {HTML|String} The label to set
* @private
*/
_uiSetLabel: function (label) {
@@ -157,7 +165,7 @@ ButtonCore.prototype = {
if (tagName === 'input') {
node.set('value', label);
} else {
- (node.one('.' + ButtonCore.CLASS_NAMES.LABEL) || node).set('text', label);
+ (node.one('.' + ButtonCore.CLASS_NAMES.LABEL) || node).setHTML(label);
}
return label;
@@ -171,10 +179,10 @@ ButtonCore.prototype = {
*/
_uiSetDisabled: function(value) {
var node = this.getNode();
-
+
node.getDOMNode().disabled = value; // avoid rerunning setter when this === node
node.toggleClass(ButtonCore.CLASS_NAMES.DISABLED, value);
-
+
return value;
}
};
@@ -196,9 +204,10 @@ ButtonCore.ATTRS = {
* The text of the button (the `value` or `text` property)
*
* @attribute label
- * @type String
+ * @type {HTML|String}
*/
label: {
+ valueFn: '_getLabel',
setter: '_uiSetLabel',
getter: '_getLabel',
lazyAdd: false
@@ -271,4 +280,5 @@ ButtonCore.ARIA_ROLES = {
// Export Button
Y.ButtonCore = ButtonCore;
+
}, '@VERSION@', {"requires": ["attribute-core", "classnamemanager", "node-base"]});
diff --git a/build/button-core/button-core-min.js b/build/button-core/button-core-min.js
index 032817941bb..0918aa0f8db 100644
--- a/build/button-core/button-core-min.js
+++ b/build/button-core/button-core-min.js
@@ -1 +1 @@
-YUI.add("button-core",function(e,t){function r(e){this.initializer(e)}var n=e.ClassNameManager.getClassName;r.prototype={TEMPLATE:"",constructor:r,initializer:function(e){this._initNode(e),this._initAttributes(e),this._renderUI(e)},_initNode:function(t){t.host?this._host=e.one(t.host):this._host=e.Node.create(this.TEMPLATE)},_initAttributes:function(t){var n=this._host,i=n.one("."+r.CLASS_NAMES.LABEL)||n;t.label=t.label||this._getLabel(i),e.AttributeCore.call(this,r.ATTRS,t)},_renderUI:function(){var e=this.getNode(),t=e.get("tagName").toLowerCase();e.addClass(r.CLASS_NAMES.BUTTON),t!=="button"&&t!=="input"&&e.set("role","button")},enable:function(){this.set("disabled",!1)},disable:function(){this.set("disabled",!0)},getNode:function(){return this._host},_getLabel:function(){var e=this.getNode(),t=e.get("tagName").toLowerCase(),n;return t==="input"?n=e.get("value"):n=(e.one("."+r.CLASS_NAMES.LABEL)||e).get("text"),n},_uiSetLabel:function(e){var t=this.getNode(),n=t.get("tagName").toLowerCase();return n==="input"?t.set("value",e):(t.one("."+r.CLASS_NAMES.LABEL)||t).set("text",e),e},_uiSetDisabled:function(e){var t=this.getNode();return t.getDOMNode().disabled=e,t.toggleClass(r.CLASS_NAMES.DISABLED,e),e}},e.mix(r.prototype,e.AttributeCore.prototype),r.ATTRS={label:{setter:"_uiSetLabel",getter:"_getLabel",lazyAdd:!1},disabled:{value:!1,setter:"_uiSetDisabled",lazyAdd:!1}},r.NAME="button",r.CLASS_NAMES={BUTTON:n("button"),DISABLED:n("button","disabled"),SELECTED:n("button","selected"),LABEL:n("button","label")},r.ARIA_STATES={PRESSED:"aria-pressed",CHECKED:"aria-checked"},r.ARIA_ROLES={BUTTON:"button",CHECKBOX:"checkbox",TOGGLE:"toggle"},e.ButtonCore=r},"@VERSION@",{requires:["attribute-core","classnamemanager","node-base"]});
+YUI.add("button-core",function(e,t){function r(e){this.initializer(e)}var n=e.ClassNameManager.getClassName;r.prototype={TEMPLATE:"",constructor:r,initializer:function(e){this._initNode(e),this._initAttributes(e),this._renderUI(e)},_initNode:function(t){t.host?this._host=e.one(t.host):this._host=e.Node.create(this.TEMPLATE)},_initAttributes:function(t){e.AttributeCore.call(this,r.ATTRS,t)},_renderUI:function(){var e=this.getNode(),t=e.get("tagName").toLowerCase();e.addClass(r.CLASS_NAMES.BUTTON),t!=="button"&&t!=="input"&&e.set("role","button")},enable:function(){this.set("disabled",!1)},disable:function(){this.set("disabled",!0)},getNode:function(){return this._host},_getLabel:function(){var e=this.getNode();return this._getLabelFromNode(e)},_getLabelFromNode:function(e){var t=e.get("tagName").toLowerCase(),n;return t==="input"?n=e.get("value"):n=(e.one("."+r.CLASS_NAMES.LABEL)||e).getHTML(),n},_uiSetLabel:function(e){var t=this.getNode(),n=t.get("tagName").toLowerCase();return n==="input"?t.set("value",e):(t.one("."+r.CLASS_NAMES.LABEL)||t).setHTML(e),e},_uiSetDisabled:function(e){var t=this.getNode();return t.getDOMNode().disabled=e,t.toggleClass(r.CLASS_NAMES.DISABLED,e),e}},e.mix(r.prototype,e.AttributeCore.prototype),r.ATTRS={label:{valueFn:"_getLabel",setter:"_uiSetLabel",getter:"_getLabel",lazyAdd:!1},disabled:{value:!1,setter:"_uiSetDisabled",lazyAdd:!1}},r.NAME="button",r.CLASS_NAMES={BUTTON:n("button"),DISABLED:n("button","disabled"),SELECTED:n("button","selected"),LABEL:n("button","label")},r.ARIA_STATES={PRESSED:"aria-pressed",CHECKED:"aria-checked"},r.ARIA_ROLES={BUTTON:"button",CHECKBOX:"checkbox",TOGGLE:"toggle"},e.ButtonCore=r},"@VERSION@",{requires:["attribute-core","classnamemanager","node-base"]});
diff --git a/build/button-core/button-core.js b/build/button-core/button-core.js
index f63c3f562df..d9fc9cb6cfe 100644
--- a/build/button-core/button-core.js
+++ b/build/button-core/button-core.js
@@ -72,10 +72,6 @@ ButtonCore.prototype = {
* @private
*/
_initAttributes: function(config) {
- var host = this._host,
- node = host.one('.' + ButtonCore.CLASS_NAMES.LABEL) || host;
-
- config.label = config.label || this._getLabel(node);
Y.AttributeCore.call(this, ButtonCore.ATTRS, config);
},
@@ -91,7 +87,7 @@ ButtonCore.prototype = {
// Set some default node attributes
node.addClass(ButtonCore.CLASS_NAMES.BUTTON);
-
+
if (tagName !== 'button' && tagName !== 'input') {
node.set('role', 'button');
}
@@ -123,31 +119,43 @@ ButtonCore.prototype = {
getNode: function() {
return this._host;
},
-
+
/**
* @method _getLabel
* @description Getter for a button's 'label' ATTR
* @private
*/
_getLabel: function () {
- var node = this.getNode(),
- tagName = node.get('tagName').toLowerCase(),
+ var node = this.getNode();
+
+ return this._getLabelFromNode(node);
+ },
+
+ /**
+ * @method _getLabelFromNode
+ * @description Getter for a button's 'label' ATTR
+ * @param node {Node} The Y.Node instance to obtain the label from
+ * @return {HTML|String} The label for a given node
+ * @private
+ */
+ _getLabelFromNode: function (node) {
+ var tagName = node.get('tagName').toLowerCase(),
label;
if (tagName === 'input') {
label = node.get('value');
}
else {
- label = (node.one('.' + ButtonCore.CLASS_NAMES.LABEL) || node).get('text');
+ label = (node.one('.' + ButtonCore.CLASS_NAMES.LABEL) || node).getHTML();
}
-
+
return label;
},
-
+
/**
* @method _uiSetLabel
* @description Setter for a button's 'label' ATTR
- * @param label {string}
+ * @param label {HTML|String} The label to set
* @private
*/
_uiSetLabel: function (label) {
@@ -157,7 +165,7 @@ ButtonCore.prototype = {
if (tagName === 'input') {
node.set('value', label);
} else {
- (node.one('.' + ButtonCore.CLASS_NAMES.LABEL) || node).set('text', label);
+ (node.one('.' + ButtonCore.CLASS_NAMES.LABEL) || node).setHTML(label);
}
return label;
@@ -171,10 +179,10 @@ ButtonCore.prototype = {
*/
_uiSetDisabled: function(value) {
var node = this.getNode();
-
+
node.getDOMNode().disabled = value; // avoid rerunning setter when this === node
node.toggleClass(ButtonCore.CLASS_NAMES.DISABLED, value);
-
+
return value;
}
};
@@ -196,9 +204,10 @@ ButtonCore.ATTRS = {
* The text of the button (the `value` or `text` property)
*
* @attribute label
- * @type String
+ * @type {HTML|String}
*/
label: {
+ valueFn: '_getLabel',
setter: '_uiSetLabel',
getter: '_getLabel',
lazyAdd: false
@@ -271,4 +280,5 @@ ButtonCore.ARIA_ROLES = {
// Export Button
Y.ButtonCore = ButtonCore;
+
}, '@VERSION@', {"requires": ["attribute-core", "classnamemanager", "node-base"]});
diff --git a/build/button/button-coverage.js b/build/button/button-coverage.js
index ea4582f604e..569ce4f8c9f 100644
--- a/build/button/button-coverage.js
+++ b/build/button/button-coverage.js
@@ -1,6 +1,6 @@
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/button/button.js']) {
- __coverage__['build/button/button.js'] = {"path":"build/button/button.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":37}}},"2":{"name":"Button","line":23,"loc":{"start":{"line":23,"column":0},"end":{"line":23,"column":18}}},"3":{"name":"(anonymous_3)","line":54,"loc":{"start":{"line":54,"column":17},"end":{"line":54,"column":34}}},"4":{"name":"(anonymous_4)","line":71,"loc":{"start":{"line":71,"column":12},"end":{"line":71,"column":23}}},"5":{"name":"(anonymous_5)","line":81,"loc":{"start":{"line":81,"column":12},"end":{"line":81,"column":23}}},"6":{"name":"(anonymous_6)","line":91,"loc":{"start":{"line":91,"column":23},"end":{"line":91,"column":35}}},"7":{"name":"(anonymous_7)","line":99,"loc":{"start":{"line":99,"column":26},"end":{"line":99,"column":38}}},"8":{"name":"(anonymous_8)","line":151,"loc":{"start":{"line":151,"column":15},"end":{"line":151,"column":30}}},"9":{"name":"(anonymous_9)","line":156,"loc":{"start":{"line":156,"column":18},"end":{"line":156,"column":33}}},"10":{"name":"ToggleButton","line":181,"loc":{"start":{"line":181,"column":0},"end":{"line":181,"column":24}}},"11":{"name":"(anonymous_11)","line":211,"loc":{"start":{"line":211,"column":17},"end":{"line":211,"column":35}}},"12":{"name":"(anonymous_12)","line":229,"loc":{"start":{"line":229,"column":16},"end":{"line":229,"column":28}}},"13":{"name":"(anonymous_13)","line":237,"loc":{"start":{"line":237,"column":12},"end":{"line":237,"column":23}}},"14":{"name":"(anonymous_14)","line":251,"loc":{"start":{"line":251,"column":12},"end":{"line":251,"column":23}}},"15":{"name":"(anonymous_15)","line":269,"loc":{"start":{"line":269,"column":26},"end":{"line":269,"column":37}}},"16":{"name":"(anonymous_16)","line":277,"loc":{"start":{"line":277,"column":20},"end":{"line":277,"column":36}}},"17":{"name":"(anonymous_17)","line":293,"loc":{"start":{"line":293,"column":12},"end":{"line":293,"column":23}}},"18":{"name":"(anonymous_18)","line":342,"loc":{"start":{"line":342,"column":17},"end":{"line":342,"column":32}}},"19":{"name":"(anonymous_19)","line":345,"loc":{"start":{"line":345,"column":17},"end":{"line":345,"column":32}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":382,"column":70}},"2":{"start":{"line":10,"column":0},"end":{"line":12,"column":42}},"3":{"start":{"line":23,"column":0},"end":{"line":25,"column":1}},"4":{"start":{"line":24,"column":4},"end":{"line":24,"column":57}},"5":{"start":{"line":28,"column":0},"end":{"line":169,"column":3}},"6":{"start":{"line":56,"column":8},"end":{"line":56,"column":45}},"7":{"start":{"line":60,"column":8},"end":{"line":62,"column":9}},"8":{"start":{"line":61,"column":12},"end":{"line":61,"column":50}},"9":{"start":{"line":72,"column":8},"end":{"line":72,"column":26}},"10":{"start":{"line":73,"column":8},"end":{"line":73,"column":62}},"11":{"start":{"line":74,"column":8},"end":{"line":74,"column":68}},"12":{"start":{"line":82,"column":8},"end":{"line":82,"column":26}},"13":{"start":{"line":83,"column":8},"end":{"line":83,"column":77}},"14":{"start":{"line":84,"column":8},"end":{"line":84,"column":83}},"15":{"start":{"line":92,"column":8},"end":{"line":92,"column":64}},"16":{"start":{"line":104,"column":8},"end":{"line":104,"column":67}},"17":{"start":{"line":152,"column":12},"end":{"line":152,"column":30}},"18":{"start":{"line":153,"column":12},"end":{"line":153,"column":36}},"19":{"start":{"line":157,"column":12},"end":{"line":157,"column":46}},"20":{"start":{"line":171,"column":0},"end":{"line":171,"column":48}},"21":{"start":{"line":181,"column":0},"end":{"line":183,"column":1}},"22":{"start":{"line":182,"column":4},"end":{"line":182,"column":57}},"23":{"start":{"line":187,"column":0},"end":{"line":375,"column":3}},"24":{"start":{"line":212,"column":8},"end":{"line":215,"column":62}},"25":{"start":{"line":218,"column":8},"end":{"line":220,"column":11}},"26":{"start":{"line":222,"column":8},"end":{"line":222,"column":51}},"27":{"start":{"line":230,"column":8},"end":{"line":230,"column":37}},"28":{"start":{"line":238,"column":9},"end":{"line":239,"column":43}},"29":{"start":{"line":241,"column":8},"end":{"line":241,"column":52}},"30":{"start":{"line":243,"column":8},"end":{"line":243,"column":53}},"31":{"start":{"line":244,"column":8},"end":{"line":244,"column":86}},"32":{"start":{"line":252,"column":8},"end":{"line":257,"column":55}},"33":{"start":{"line":259,"column":8},"end":{"line":259,"column":52}},"34":{"start":{"line":261,"column":8},"end":{"line":261,"column":29}},"35":{"start":{"line":262,"column":8},"end":{"line":262,"column":60}},"36":{"start":{"line":270,"column":8},"end":{"line":270,"column":38}},"37":{"start":{"line":278,"column":8},"end":{"line":282,"column":80}},"38":{"start":{"line":284,"column":8},"end":{"line":284,"column":59}},"39":{"start":{"line":285,"column":8},"end":{"line":285,"column":33}},"40":{"start":{"line":294,"column":8},"end":{"line":294,"column":26}},"41":{"start":{"line":295,"column":8},"end":{"line":295,"column":83}},"42":{"start":{"line":343,"column":12},"end":{"line":343,"column":55}},"43":{"start":{"line":346,"column":12},"end":{"line":346,"column":55}},"44":{"start":{"line":378,"column":0},"end":{"line":378,"column":18}},"45":{"start":{"line":379,"column":0},"end":{"line":379,"column":30}}},"branchMap":{"1":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":8},"end":{"line":60,"column":8}},{"start":{"line":60,"column":8},"end":{"line":60,"column":8}}]},"2":{"line":214,"type":"cond-expr","locations":[{"start":{"line":214,"column":54},"end":{"line":214,"column":63}},{"start":{"line":214,"column":66},"end":{"line":214,"column":75}}]},"3":{"line":215,"type":"binary-expr","locations":[{"start":{"line":215,"column":28},"end":{"line":215,"column":52}},{"start":{"line":215,"column":56},"end":{"line":215,"column":61}}]},"4":{"line":256,"type":"cond-expr","locations":[{"start":{"line":256,"column":42},"end":{"line":256,"column":56}},{"start":{"line":256,"column":59},"end":{"line":256,"column":71}}]},"5":{"line":282,"type":"cond-expr","locations":[{"start":{"line":282,"column":47},"end":{"line":282,"column":61}},{"start":{"line":282,"column":64},"end":{"line":282,"column":78}}]}},"code":["(function () { YUI.add('button', function (Y, NAME) {","","/**"," * A Button Widget"," *"," * @module button"," * @since 3.5.0"," */","","var CLASS_NAMES = Y.ButtonCore.CLASS_NAMES,"," ARIA_STATES = Y.ButtonCore.ARIA_STATES,"," ARIA_ROLES = Y.ButtonCore.ARIA_ROLES;","","/**"," * Creates a Button"," *"," * @class Button"," * @extends Widget"," * @uses ButtonCore"," * @param config {Object} Configuration object"," * @constructor"," */","function Button() {"," Button.superclass.constructor.apply(this, arguments);","}","","/* Button extends Widget */","Y.extend(Button, Y.Widget, {",""," /**"," * Bounding box template that will contain the Button's DOM subtree."," *"," * @property BOUNDING_TEMPLATE"," * @type {String}"," * @default "," */"," BOUNDING_TEMPLATE : Y.ButtonCore.prototype.TEMPLATE,",""," /**"," * Content box template"," *"," * @property CONTENT_TEMPLATE"," * @type {String}"," * @default null"," */"," CONTENT_TEMPLATE : null,",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," // ButtonCore requires this"," this._host = this.get('boundingBox');",""," // A workaround until there's a better way to handle setting Node attributes"," // via HTML parsing in classes that extend Widget"," if (config.disabled) {"," this.set('disabled', config.disabled);"," }"," },",""," /**"," * bindUI implementation"," *"," * @description Hooks up events for the widget"," * @method bindUI"," */"," bindUI: function() {"," var button = this;"," button.after('labelChange', button._afterLabelChange);"," button.after('disabledChange', button._afterDisabledChange);"," },",""," /**"," * @method syncUI"," * @description Updates button attributes"," */"," syncUI: function() {"," var button = this;"," Y.ButtonCore.prototype._uiSetLabel.call(button, button.get('label'));"," Y.ButtonCore.prototype._uiSetDisabled.call(button, button.get('disabled'));"," },",""," /**"," * @method _afterLabelChange"," * @private"," */"," _afterLabelChange: function(e) {"," Y.ButtonCore.prototype._uiSetLabel.call(this, e.newVal);"," },",""," /**"," * @method _afterDisabledChange"," * @private"," */"," _afterDisabledChange: function(e) {"," // Unable to use `this._uiSetDisabled` because that points"," // to `Y.Widget.prototype._uiSetDisabled`."," // This works for now."," // @TODO Investigate most appropriate solution."," Y.ButtonCore.prototype._uiSetDisabled.call(this, e.newVal);"," }","","}, {"," // Y.Button static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'button'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'button',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * The text of the button (the `value` or `text` property)"," *"," * @attribute label"," * @type String"," */"," label: {"," value: Y.ButtonCore.ATTRS.label.value"," }"," },",""," /**"," * @property HTML_PARSER"," * @type {Object}"," * @protected"," * @static"," */"," HTML_PARSER: {"," label: function(node) {"," this._host = node; // TODO: remove"," return this._getLabel();"," },",""," disabled: function(node) {"," return node.getDOMNode().disabled;"," }"," },",""," /**"," * List of class names used in the Button's DOM"," *"," * @property CLASS_NAMES"," * @type Object"," * @static"," */"," CLASS_NAMES: CLASS_NAMES","});","","Y.mix(Button.prototype, Y.ButtonCore.prototype);","","/**"," * Creates a ToggleButton"," *"," * @class ToggleButton"," * @extends Button"," * @param config {Object} Configuration object"," * @constructor"," */","function ToggleButton() {"," Button.superclass.constructor.apply(this, arguments);","}","","// TODO: move to ButtonCore subclass to enable toggle plugin, widget, etc.","/* ToggleButton extends Button */","Y.extend(ToggleButton, Button, {",""," /**"," *"," *"," * @property trigger"," * @type {String}"," * @default"," */"," trigger: 'click',",""," /**"," *"," *"," * @property selectedAttrName"," * @type {String}"," * @default"," */"," selectedAttrName: '',"," "," /**"," *"," * @method initializer"," */"," initializer: function (config) {"," var button = this,"," type = button.get('type'),"," selectedAttrName = (type === \"checkbox\" ? 'checked' : 'pressed'),"," selectedState = config[selectedAttrName] || false;"," "," // Create the checked/pressed attribute"," button.addAttr(selectedAttrName, {"," value: selectedState"," });"," "," button.selectedAttrName = selectedAttrName;"," },"," "," /**"," *"," * @method destructor"," */"," destructor: function () {"," delete this.selectedAttrName;"," },"," "," /**"," * @method bindUI"," * @description Hooks up events for the widget"," */"," bindUI: function() {"," var button = this,"," cb = button.get('contentBox');"," "," ToggleButton.superclass.bindUI.call(button);"," "," cb.on(button.trigger, button.toggle, button);"," button.after(button.selectedAttrName + 'Change', button._afterSelectedChange);"," },",""," /**"," * @method syncUI"," * @description Syncs the UI for the widget"," */"," syncUI: function() {"," var button = this,"," cb = button.get('contentBox'),"," type = button.get('type'),"," ROLES = ToggleButton.ARIA_ROLES,"," role = (type === 'checkbox' ? ROLES.CHECKBOX : ROLES.TOGGLE),"," selectedAttrName = button.selectedAttrName;",""," ToggleButton.superclass.syncUI.call(button);"," "," cb.set('role', role);"," button._uiSetSelected(button.get(selectedAttrName));"," },"," "," /**"," * @method _afterSelectedChange"," * @private"," */"," _afterSelectedChange: function(e){"," this._uiSetSelected(e.newVal);"," },"," "," /**"," * @method _uiSetSelected"," * @private"," */"," _uiSetSelected: function(value) {"," var button = this,"," cb = button.get('contentBox'),"," STATES = ToggleButton.ARIA_STATES,"," type = button.get('type'),"," ariaState = (type === 'checkbox' ? STATES.CHECKED : STATES.PRESSED);"," "," cb.toggleClass(Button.CLASS_NAMES.SELECTED, value);"," cb.set(ariaState, value);"," },"," "," /**"," * @method toggle"," * @description Toggles the selected/pressed/checked state of a ToggleButton"," * @public"," */"," toggle: function() {"," var button = this;"," button._set(button.selectedAttrName, !button.get(button.selectedAttrName));"," }","","}, {"," "," /**"," * The identity of the widget."," *"," * @property NAME"," * @type {String}"," * @default 'buttongroup'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'toggleButton',"," "," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," *"," *"," * @attribute type"," * @type String"," */"," type: {"," value: 'toggle',"," writeOnce: 'initOnly'"," }"," },"," "," /**"," * @property HTML_PARSER"," * @type {Object}"," * @protected"," * @static"," */"," HTML_PARSER: {"," checked: function(node) {"," return node.hasClass(CLASS_NAMES.SELECTED);"," },"," pressed: function(node) {"," return node.hasClass(CLASS_NAMES.SELECTED);"," }"," },"," "," /**"," * @property ARIA_STATES"," * @type {Object}"," * @protected"," * @static"," */"," ARIA_STATES: ARIA_STATES,",""," /**"," * @property ARIA_ROLES"," * @type {Object}"," * @protected"," * @static"," */"," ARIA_ROLES: ARIA_ROLES,",""," /**"," * Array of static constants used to identify the classnames applied to DOM nodes"," *"," * @property CLASS_NAMES"," * @type Object"," * @static"," */"," CLASS_NAMES: CLASS_NAMES"," ","});","","// Export","Y.Button = Button;","Y.ToggleButton = ToggleButton;","","","}, '@VERSION@', {\"requires\": [\"button-core\", \"cssbutton\", \"widget\"]});","","}());"]};
+ __coverage__['build/button/button.js'] = {"path":"build/button/button.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":37}}},"2":{"name":"Button","line":23,"loc":{"start":{"line":23,"column":0},"end":{"line":23,"column":18}}},"3":{"name":"(anonymous_3)","line":54,"loc":{"start":{"line":54,"column":17},"end":{"line":54,"column":34}}},"4":{"name":"(anonymous_4)","line":71,"loc":{"start":{"line":71,"column":12},"end":{"line":71,"column":23}}},"5":{"name":"(anonymous_5)","line":81,"loc":{"start":{"line":81,"column":12},"end":{"line":81,"column":23}}},"6":{"name":"(anonymous_6)","line":91,"loc":{"start":{"line":91,"column":23},"end":{"line":91,"column":35}}},"7":{"name":"(anonymous_7)","line":99,"loc":{"start":{"line":99,"column":26},"end":{"line":99,"column":38}}},"8":{"name":"(anonymous_8)","line":150,"loc":{"start":{"line":150,"column":15},"end":{"line":150,"column":30}}},"9":{"name":"(anonymous_9)","line":154,"loc":{"start":{"line":154,"column":18},"end":{"line":154,"column":33}}},"10":{"name":"ToggleButton","line":179,"loc":{"start":{"line":179,"column":0},"end":{"line":179,"column":24}}},"11":{"name":"(anonymous_11)","line":209,"loc":{"start":{"line":209,"column":17},"end":{"line":209,"column":35}}},"12":{"name":"(anonymous_12)","line":227,"loc":{"start":{"line":227,"column":16},"end":{"line":227,"column":28}}},"13":{"name":"(anonymous_13)","line":235,"loc":{"start":{"line":235,"column":12},"end":{"line":235,"column":23}}},"14":{"name":"(anonymous_14)","line":249,"loc":{"start":{"line":249,"column":12},"end":{"line":249,"column":23}}},"15":{"name":"(anonymous_15)","line":267,"loc":{"start":{"line":267,"column":26},"end":{"line":267,"column":37}}},"16":{"name":"(anonymous_16)","line":275,"loc":{"start":{"line":275,"column":20},"end":{"line":275,"column":36}}},"17":{"name":"(anonymous_17)","line":291,"loc":{"start":{"line":291,"column":12},"end":{"line":291,"column":23}}},"18":{"name":"(anonymous_18)","line":340,"loc":{"start":{"line":340,"column":17},"end":{"line":340,"column":32}}},"19":{"name":"(anonymous_19)","line":343,"loc":{"start":{"line":343,"column":17},"end":{"line":343,"column":32}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":380,"column":70}},"2":{"start":{"line":10,"column":0},"end":{"line":12,"column":42}},"3":{"start":{"line":23,"column":0},"end":{"line":25,"column":1}},"4":{"start":{"line":24,"column":4},"end":{"line":24,"column":57}},"5":{"start":{"line":28,"column":0},"end":{"line":167,"column":3}},"6":{"start":{"line":56,"column":8},"end":{"line":56,"column":45}},"7":{"start":{"line":60,"column":8},"end":{"line":62,"column":9}},"8":{"start":{"line":61,"column":12},"end":{"line":61,"column":50}},"9":{"start":{"line":72,"column":8},"end":{"line":72,"column":26}},"10":{"start":{"line":73,"column":8},"end":{"line":73,"column":62}},"11":{"start":{"line":74,"column":8},"end":{"line":74,"column":68}},"12":{"start":{"line":82,"column":8},"end":{"line":82,"column":26}},"13":{"start":{"line":83,"column":8},"end":{"line":83,"column":77}},"14":{"start":{"line":84,"column":8},"end":{"line":84,"column":83}},"15":{"start":{"line":92,"column":8},"end":{"line":92,"column":64}},"16":{"start":{"line":104,"column":8},"end":{"line":104,"column":67}},"17":{"start":{"line":151,"column":12},"end":{"line":151,"column":48}},"18":{"start":{"line":155,"column":12},"end":{"line":155,"column":46}},"19":{"start":{"line":169,"column":0},"end":{"line":169,"column":48}},"20":{"start":{"line":179,"column":0},"end":{"line":181,"column":1}},"21":{"start":{"line":180,"column":4},"end":{"line":180,"column":57}},"22":{"start":{"line":185,"column":0},"end":{"line":373,"column":3}},"23":{"start":{"line":210,"column":8},"end":{"line":213,"column":62}},"24":{"start":{"line":216,"column":8},"end":{"line":218,"column":11}},"25":{"start":{"line":220,"column":8},"end":{"line":220,"column":51}},"26":{"start":{"line":228,"column":8},"end":{"line":228,"column":37}},"27":{"start":{"line":236,"column":9},"end":{"line":237,"column":43}},"28":{"start":{"line":239,"column":8},"end":{"line":239,"column":52}},"29":{"start":{"line":241,"column":8},"end":{"line":241,"column":53}},"30":{"start":{"line":242,"column":8},"end":{"line":242,"column":86}},"31":{"start":{"line":250,"column":8},"end":{"line":255,"column":55}},"32":{"start":{"line":257,"column":8},"end":{"line":257,"column":52}},"33":{"start":{"line":259,"column":8},"end":{"line":259,"column":29}},"34":{"start":{"line":260,"column":8},"end":{"line":260,"column":60}},"35":{"start":{"line":268,"column":8},"end":{"line":268,"column":38}},"36":{"start":{"line":276,"column":8},"end":{"line":280,"column":80}},"37":{"start":{"line":282,"column":8},"end":{"line":282,"column":59}},"38":{"start":{"line":283,"column":8},"end":{"line":283,"column":33}},"39":{"start":{"line":292,"column":8},"end":{"line":292,"column":26}},"40":{"start":{"line":293,"column":8},"end":{"line":293,"column":83}},"41":{"start":{"line":341,"column":12},"end":{"line":341,"column":55}},"42":{"start":{"line":344,"column":12},"end":{"line":344,"column":55}},"43":{"start":{"line":376,"column":0},"end":{"line":376,"column":18}},"44":{"start":{"line":377,"column":0},"end":{"line":377,"column":30}}},"branchMap":{"1":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":8},"end":{"line":60,"column":8}},{"start":{"line":60,"column":8},"end":{"line":60,"column":8}}]},"2":{"line":212,"type":"cond-expr","locations":[{"start":{"line":212,"column":54},"end":{"line":212,"column":63}},{"start":{"line":212,"column":66},"end":{"line":212,"column":75}}]},"3":{"line":213,"type":"binary-expr","locations":[{"start":{"line":213,"column":28},"end":{"line":213,"column":52}},{"start":{"line":213,"column":56},"end":{"line":213,"column":61}}]},"4":{"line":254,"type":"cond-expr","locations":[{"start":{"line":254,"column":42},"end":{"line":254,"column":56}},{"start":{"line":254,"column":59},"end":{"line":254,"column":71}}]},"5":{"line":280,"type":"cond-expr","locations":[{"start":{"line":280,"column":47},"end":{"line":280,"column":61}},{"start":{"line":280,"column":64},"end":{"line":280,"column":78}}]}},"code":["(function () { YUI.add('button', function (Y, NAME) {","","/**"," * A Button Widget"," *"," * @module button"," * @since 3.5.0"," */","","var CLASS_NAMES = Y.ButtonCore.CLASS_NAMES,"," ARIA_STATES = Y.ButtonCore.ARIA_STATES,"," ARIA_ROLES = Y.ButtonCore.ARIA_ROLES;","","/**"," * Creates a Button"," *"," * @class Button"," * @extends Widget"," * @uses ButtonCore"," * @param config {Object} Configuration object"," * @constructor"," */","function Button() {"," Button.superclass.constructor.apply(this, arguments);","}","","/* Button extends Widget */","Y.extend(Button, Y.Widget, {",""," /**"," * Bounding box template that will contain the Button's DOM subtree."," *"," * @property BOUNDING_TEMPLATE"," * @type {String}"," * @default "," */"," BOUNDING_TEMPLATE : Y.ButtonCore.prototype.TEMPLATE,",""," /**"," * Content box template"," *"," * @property CONTENT_TEMPLATE"," * @type {String}"," * @default null"," */"," CONTENT_TEMPLATE : null,",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," // ButtonCore requires this"," this._host = this.get('boundingBox');",""," // A workaround until there's a better way to handle setting Node attributes"," // via HTML parsing in classes that extend Widget"," if (config.disabled) {"," this.set('disabled', config.disabled);"," }"," },",""," /**"," * bindUI implementation"," *"," * @description Hooks up events for the widget"," * @method bindUI"," */"," bindUI: function() {"," var button = this;"," button.after('labelChange', button._afterLabelChange);"," button.after('disabledChange', button._afterDisabledChange);"," },",""," /**"," * @method syncUI"," * @description Updates button attributes"," */"," syncUI: function() {"," var button = this;"," Y.ButtonCore.prototype._uiSetLabel.call(button, button.get('label'));"," Y.ButtonCore.prototype._uiSetDisabled.call(button, button.get('disabled'));"," },",""," /**"," * @method _afterLabelChange"," * @private"," */"," _afterLabelChange: function(e) {"," Y.ButtonCore.prototype._uiSetLabel.call(this, e.newVal);"," },",""," /**"," * @method _afterDisabledChange"," * @private"," */"," _afterDisabledChange: function(e) {"," // Unable to use `this._uiSetDisabled` because that points"," // to `Y.Widget.prototype._uiSetDisabled`."," // This works for now."," // @TODO Investigate most appropriate solution."," Y.ButtonCore.prototype._uiSetDisabled.call(this, e.newVal);"," }","","}, {"," // Y.Button static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'button'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'button',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {"," /**"," * The text of the button (the `value` or `text` property)"," *"," * @attribute label"," * @type {HTML|String}"," */"," label: {"," value: Y.ButtonCore.ATTRS.label.value"," }"," },",""," /**"," * @property HTML_PARSER"," * @type {Object}"," * @protected"," * @static"," */"," HTML_PARSER: {"," label: function(node) {"," return this._getLabelFromNode(node);"," },",""," disabled: function(node) {"," return node.getDOMNode().disabled;"," }"," },",""," /**"," * List of class names used in the Button's DOM"," *"," * @property CLASS_NAMES"," * @type Object"," * @static"," */"," CLASS_NAMES: CLASS_NAMES","});","","Y.mix(Button.prototype, Y.ButtonCore.prototype);","","/**"," * Creates a ToggleButton"," *"," * @class ToggleButton"," * @extends Button"," * @param config {Object} Configuration object"," * @constructor"," */","function ToggleButton() {"," Button.superclass.constructor.apply(this, arguments);","}","","// TODO: move to ButtonCore subclass to enable toggle plugin, widget, etc.","/* ToggleButton extends Button */","Y.extend(ToggleButton, Button, {",""," /**"," *"," *"," * @property trigger"," * @type {String}"," * @default"," */"," trigger: 'click',",""," /**"," *"," *"," * @property selectedAttrName"," * @type {String}"," * @default"," */"," selectedAttrName: '',"," "," /**"," *"," * @method initializer"," */"," initializer: function (config) {"," var button = this,"," type = button.get('type'),"," selectedAttrName = (type === \"checkbox\" ? 'checked' : 'pressed'),"," selectedState = config[selectedAttrName] || false;"," "," // Create the checked/pressed attribute"," button.addAttr(selectedAttrName, {"," value: selectedState"," });"," "," button.selectedAttrName = selectedAttrName;"," },"," "," /**"," *"," * @method destructor"," */"," destructor: function () {"," delete this.selectedAttrName;"," },"," "," /**"," * @method bindUI"," * @description Hooks up events for the widget"," */"," bindUI: function() {"," var button = this,"," cb = button.get('contentBox');"," "," ToggleButton.superclass.bindUI.call(button);"," "," cb.on(button.trigger, button.toggle, button);"," button.after(button.selectedAttrName + 'Change', button._afterSelectedChange);"," },",""," /**"," * @method syncUI"," * @description Syncs the UI for the widget"," */"," syncUI: function() {"," var button = this,"," cb = button.get('contentBox'),"," type = button.get('type'),"," ROLES = ToggleButton.ARIA_ROLES,"," role = (type === 'checkbox' ? ROLES.CHECKBOX : ROLES.TOGGLE),"," selectedAttrName = button.selectedAttrName;",""," ToggleButton.superclass.syncUI.call(button);"," "," cb.set('role', role);"," button._uiSetSelected(button.get(selectedAttrName));"," },"," "," /**"," * @method _afterSelectedChange"," * @private"," */"," _afterSelectedChange: function(e){"," this._uiSetSelected(e.newVal);"," },"," "," /**"," * @method _uiSetSelected"," * @private"," */"," _uiSetSelected: function(value) {"," var button = this,"," cb = button.get('contentBox'),"," STATES = ToggleButton.ARIA_STATES,"," type = button.get('type'),"," ariaState = (type === 'checkbox' ? STATES.CHECKED : STATES.PRESSED);"," "," cb.toggleClass(Button.CLASS_NAMES.SELECTED, value);"," cb.set(ariaState, value);"," },"," "," /**"," * @method toggle"," * @description Toggles the selected/pressed/checked state of a ToggleButton"," * @public"," */"," toggle: function() {"," var button = this;"," button._set(button.selectedAttrName, !button.get(button.selectedAttrName));"," }","","}, {"," "," /**"," * The identity of the widget."," *"," * @property NAME"," * @type {String}"," * @default 'buttongroup'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'toggleButton',"," "," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," *"," *"," * @attribute type"," * @type String"," */"," type: {"," value: 'toggle',"," writeOnce: 'initOnly'"," }"," },"," "," /**"," * @property HTML_PARSER"," * @type {Object}"," * @protected"," * @static"," */"," HTML_PARSER: {"," checked: function(node) {"," return node.hasClass(CLASS_NAMES.SELECTED);"," },"," pressed: function(node) {"," return node.hasClass(CLASS_NAMES.SELECTED);"," }"," },"," "," /**"," * @property ARIA_STATES"," * @type {Object}"," * @protected"," * @static"," */"," ARIA_STATES: ARIA_STATES,",""," /**"," * @property ARIA_ROLES"," * @type {Object}"," * @protected"," * @static"," */"," ARIA_ROLES: ARIA_ROLES,",""," /**"," * Array of static constants used to identify the classnames applied to DOM nodes"," *"," * @property CLASS_NAMES"," * @type Object"," * @static"," */"," CLASS_NAMES: CLASS_NAMES"," ","});","","// Export","Y.Button = Button;","Y.ToggleButton = ToggleButton;","","","}, '@VERSION@', {\"requires\": [\"button-core\", \"cssbutton\", \"widget\"]});","","}());"]};
}
var __cov_BK1o_AjQ9P3TgSmDw5_iQg = __coverage__['build/button/button.js'];
-__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['1']++;YUI.add('button',function(Y,NAME){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['1']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['2']++;var CLASS_NAMES=Y.ButtonCore.CLASS_NAMES,ARIA_STATES=Y.ButtonCore.ARIA_STATES,ARIA_ROLES=Y.ButtonCore.ARIA_ROLES;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['3']++;function Button(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['2']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['4']++;Button.superclass.constructor.apply(this,arguments);}__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['5']++;Y.extend(Button,Y.Widget,{BOUNDING_TEMPLATE:Y.ButtonCore.prototype.TEMPLATE,CONTENT_TEMPLATE:null,initializer:function(config){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['3']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['6']++;this._host=this.get('boundingBox');__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['7']++;if(config.disabled){__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['1'][0]++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['8']++;this.set('disabled',config.disabled);}else{__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['1'][1]++;}},bindUI:function(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['4']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['9']++;var button=this;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['10']++;button.after('labelChange',button._afterLabelChange);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['11']++;button.after('disabledChange',button._afterDisabledChange);},syncUI:function(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['5']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['12']++;var button=this;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['13']++;Y.ButtonCore.prototype._uiSetLabel.call(button,button.get('label'));__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['14']++;Y.ButtonCore.prototype._uiSetDisabled.call(button,button.get('disabled'));},_afterLabelChange:function(e){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['6']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['15']++;Y.ButtonCore.prototype._uiSetLabel.call(this,e.newVal);},_afterDisabledChange:function(e){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['7']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['16']++;Y.ButtonCore.prototype._uiSetDisabled.call(this,e.newVal);}},{NAME:'button',ATTRS:{label:{value:Y.ButtonCore.ATTRS.label.value}},HTML_PARSER:{label:function(node){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['8']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['17']++;this._host=node;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['18']++;return this._getLabel();},disabled:function(node){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['9']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['19']++;return node.getDOMNode().disabled;}},CLASS_NAMES:CLASS_NAMES});__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['20']++;Y.mix(Button.prototype,Y.ButtonCore.prototype);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['21']++;function ToggleButton(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['10']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['22']++;Button.superclass.constructor.apply(this,arguments);}__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['23']++;Y.extend(ToggleButton,Button,{trigger:'click',selectedAttrName:'',initializer:function(config){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['11']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['24']++;var button=this,type=button.get('type'),selectedAttrName=type==='checkbox'?(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['2'][0]++,'checked'):(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['2'][1]++,'pressed'),selectedState=(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['3'][0]++,config[selectedAttrName])||(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['3'][1]++,false);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['25']++;button.addAttr(selectedAttrName,{value:selectedState});__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['26']++;button.selectedAttrName=selectedAttrName;},destructor:function(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['12']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['27']++;delete this.selectedAttrName;},bindUI:function(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['13']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['28']++;var button=this,cb=button.get('contentBox');__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['29']++;ToggleButton.superclass.bindUI.call(button);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['30']++;cb.on(button.trigger,button.toggle,button);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['31']++;button.after(button.selectedAttrName+'Change',button._afterSelectedChange);},syncUI:function(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['14']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['32']++;var button=this,cb=button.get('contentBox'),type=button.get('type'),ROLES=ToggleButton.ARIA_ROLES,role=type==='checkbox'?(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['4'][0]++,ROLES.CHECKBOX):(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['4'][1]++,ROLES.TOGGLE),selectedAttrName=button.selectedAttrName;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['33']++;ToggleButton.superclass.syncUI.call(button);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['34']++;cb.set('role',role);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['35']++;button._uiSetSelected(button.get(selectedAttrName));},_afterSelectedChange:function(e){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['15']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['36']++;this._uiSetSelected(e.newVal);},_uiSetSelected:function(value){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['16']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['37']++;var button=this,cb=button.get('contentBox'),STATES=ToggleButton.ARIA_STATES,type=button.get('type'),ariaState=type==='checkbox'?(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['5'][0]++,STATES.CHECKED):(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['5'][1]++,STATES.PRESSED);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['38']++;cb.toggleClass(Button.CLASS_NAMES.SELECTED,value);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['39']++;cb.set(ariaState,value);},toggle:function(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['17']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['40']++;var button=this;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['41']++;button._set(button.selectedAttrName,!button.get(button.selectedAttrName));}},{NAME:'toggleButton',ATTRS:{type:{value:'toggle',writeOnce:'initOnly'}},HTML_PARSER:{checked:function(node){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['18']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['42']++;return node.hasClass(CLASS_NAMES.SELECTED);},pressed:function(node){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['19']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['43']++;return node.hasClass(CLASS_NAMES.SELECTED);}},ARIA_STATES:ARIA_STATES,ARIA_ROLES:ARIA_ROLES,CLASS_NAMES:CLASS_NAMES});__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['44']++;Y.Button=Button;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['45']++;Y.ToggleButton=ToggleButton;},'@VERSION@',{'requires':['button-core','cssbutton','widget']});
+__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['1']++;YUI.add('button',function(Y,NAME){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['1']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['2']++;var CLASS_NAMES=Y.ButtonCore.CLASS_NAMES,ARIA_STATES=Y.ButtonCore.ARIA_STATES,ARIA_ROLES=Y.ButtonCore.ARIA_ROLES;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['3']++;function Button(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['2']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['4']++;Button.superclass.constructor.apply(this,arguments);}__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['5']++;Y.extend(Button,Y.Widget,{BOUNDING_TEMPLATE:Y.ButtonCore.prototype.TEMPLATE,CONTENT_TEMPLATE:null,initializer:function(config){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['3']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['6']++;this._host=this.get('boundingBox');__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['7']++;if(config.disabled){__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['1'][0]++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['8']++;this.set('disabled',config.disabled);}else{__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['1'][1]++;}},bindUI:function(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['4']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['9']++;var button=this;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['10']++;button.after('labelChange',button._afterLabelChange);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['11']++;button.after('disabledChange',button._afterDisabledChange);},syncUI:function(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['5']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['12']++;var button=this;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['13']++;Y.ButtonCore.prototype._uiSetLabel.call(button,button.get('label'));__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['14']++;Y.ButtonCore.prototype._uiSetDisabled.call(button,button.get('disabled'));},_afterLabelChange:function(e){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['6']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['15']++;Y.ButtonCore.prototype._uiSetLabel.call(this,e.newVal);},_afterDisabledChange:function(e){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['7']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['16']++;Y.ButtonCore.prototype._uiSetDisabled.call(this,e.newVal);}},{NAME:'button',ATTRS:{label:{value:Y.ButtonCore.ATTRS.label.value}},HTML_PARSER:{label:function(node){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['8']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['17']++;return this._getLabelFromNode(node);},disabled:function(node){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['9']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['18']++;return node.getDOMNode().disabled;}},CLASS_NAMES:CLASS_NAMES});__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['19']++;Y.mix(Button.prototype,Y.ButtonCore.prototype);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['20']++;function ToggleButton(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['10']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['21']++;Button.superclass.constructor.apply(this,arguments);}__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['22']++;Y.extend(ToggleButton,Button,{trigger:'click',selectedAttrName:'',initializer:function(config){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['11']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['23']++;var button=this,type=button.get('type'),selectedAttrName=type==='checkbox'?(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['2'][0]++,'checked'):(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['2'][1]++,'pressed'),selectedState=(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['3'][0]++,config[selectedAttrName])||(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['3'][1]++,false);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['24']++;button.addAttr(selectedAttrName,{value:selectedState});__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['25']++;button.selectedAttrName=selectedAttrName;},destructor:function(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['12']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['26']++;delete this.selectedAttrName;},bindUI:function(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['13']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['27']++;var button=this,cb=button.get('contentBox');__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['28']++;ToggleButton.superclass.bindUI.call(button);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['29']++;cb.on(button.trigger,button.toggle,button);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['30']++;button.after(button.selectedAttrName+'Change',button._afterSelectedChange);},syncUI:function(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['14']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['31']++;var button=this,cb=button.get('contentBox'),type=button.get('type'),ROLES=ToggleButton.ARIA_ROLES,role=type==='checkbox'?(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['4'][0]++,ROLES.CHECKBOX):(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['4'][1]++,ROLES.TOGGLE),selectedAttrName=button.selectedAttrName;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['32']++;ToggleButton.superclass.syncUI.call(button);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['33']++;cb.set('role',role);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['34']++;button._uiSetSelected(button.get(selectedAttrName));},_afterSelectedChange:function(e){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['15']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['35']++;this._uiSetSelected(e.newVal);},_uiSetSelected:function(value){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['16']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['36']++;var button=this,cb=button.get('contentBox'),STATES=ToggleButton.ARIA_STATES,type=button.get('type'),ariaState=type==='checkbox'?(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['5'][0]++,STATES.CHECKED):(__cov_BK1o_AjQ9P3TgSmDw5_iQg.b['5'][1]++,STATES.PRESSED);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['37']++;cb.toggleClass(Button.CLASS_NAMES.SELECTED,value);__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['38']++;cb.set(ariaState,value);},toggle:function(){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['17']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['39']++;var button=this;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['40']++;button._set(button.selectedAttrName,!button.get(button.selectedAttrName));}},{NAME:'toggleButton',ATTRS:{type:{value:'toggle',writeOnce:'initOnly'}},HTML_PARSER:{checked:function(node){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['18']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['41']++;return node.hasClass(CLASS_NAMES.SELECTED);},pressed:function(node){__cov_BK1o_AjQ9P3TgSmDw5_iQg.f['19']++;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['42']++;return node.hasClass(CLASS_NAMES.SELECTED);}},ARIA_STATES:ARIA_STATES,ARIA_ROLES:ARIA_ROLES,CLASS_NAMES:CLASS_NAMES});__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['43']++;Y.Button=Button;__cov_BK1o_AjQ9P3TgSmDw5_iQg.s['44']++;Y.ToggleButton=ToggleButton;},'@VERSION@',{'requires':['button-core','cssbutton','widget']});
diff --git a/build/button/button-debug.js b/build/button/button-debug.js
index 8e18a6c6c0e..ee87e297e73 100644
--- a/build/button/button-debug.js
+++ b/build/button/button-debug.js
@@ -129,12 +129,11 @@ Y.extend(Button, Y.Widget, {
* @static
*/
ATTRS: {
-
/**
* The text of the button (the `value` or `text` property)
*
* @attribute label
- * @type String
+ * @type {HTML|String}
*/
label: {
value: Y.ButtonCore.ATTRS.label.value
@@ -149,8 +148,7 @@ Y.extend(Button, Y.Widget, {
*/
HTML_PARSER: {
label: function(node) {
- this._host = node; // TODO: remove
- return this._getLabel();
+ return this._getLabelFromNode(node);
},
disabled: function(node) {
diff --git a/build/button/button-min.js b/build/button/button-min.js
index 8f0ad3cd6cf..d75e86ed653 100644
--- a/build/button/button-min.js
+++ b/build/button/button-min.js
@@ -1 +1 @@
-YUI.add("button",function(e,t){function s(){s.superclass.constructor.apply(this,arguments)}function o(){s.superclass.constructor.apply(this,arguments)}var n=e.ButtonCore.CLASS_NAMES,r=e.ButtonCore.ARIA_STATES,i=e.ButtonCore.ARIA_ROLES;e.extend(s,e.Widget,{BOUNDING_TEMPLATE:e.ButtonCore.prototype.TEMPLATE,CONTENT_TEMPLATE:null,initializer:function(e){this._host=this.get("boundingBox"),e.disabled&&this.set("disabled",e.disabled)},bindUI:function(){var e=this;e.after("labelChange",e._afterLabelChange),e.after("disabledChange",e._afterDisabledChange)},syncUI:function(){var t=this;e.ButtonCore.prototype._uiSetLabel.call(t,t.get("label")),e.ButtonCore.prototype._uiSetDisabled.call(t,t.get("disabled"))},_afterLabelChange:function(t){e.ButtonCore.prototype._uiSetLabel.call(this,t.newVal)},_afterDisabledChange:function(t){e.ButtonCore.prototype._uiSetDisabled.call(this,t.newVal)}},{NAME:"button",ATTRS:{label:{value:e.ButtonCore.ATTRS.label.value}},HTML_PARSER:{label:function(e){return this._host=e,this._getLabel()},disabled:function(e){return e.getDOMNode().disabled}},CLASS_NAMES:n}),e.mix(s.prototype,e.ButtonCore.prototype),e.extend(o,s,{trigger:"click",selectedAttrName:"",initializer:function(e){var t=this,n=t.get("type"),r=n==="checkbox"?"checked":"pressed",i=e[r]||!1;t.addAttr(r,{value:i}),t.selectedAttrName=r},destructor:function(){delete this.selectedAttrName},bindUI:function(){var e=this,t=e.get("contentBox");o.superclass.bindUI.call(e),t.on(e.trigger,e.toggle,e),e.after(e.selectedAttrName+"Change",e._afterSelectedChange)},syncUI:function(){var e=this,t=e.get("contentBox"),n=e.get("type"),r=o.ARIA_ROLES,i=n==="checkbox"?r.CHECKBOX:r.TOGGLE,s=e.selectedAttrName;o.superclass.syncUI.call(e),t.set("role",i),e._uiSetSelected(e.get(s))},_afterSelectedChange:function(e){this._uiSetSelected(e.newVal)},_uiSetSelected:function(e){var t=this,n=t.get("contentBox"),r=o.ARIA_STATES,i=t.get("type"),u=i==="checkbox"?r.CHECKED:r.PRESSED;n.toggleClass(s.CLASS_NAMES.SELECTED,e),n.set(u,e)},toggle:function(){var e=this;e._set(e.selectedAttrName,!e.get(e.selectedAttrName))}},{NAME:"toggleButton",ATTRS:{type:{value:"toggle",writeOnce:"initOnly"}},HTML_PARSER:{checked:function(e){return e.hasClass(n.SELECTED)},pressed:function(e){return e.hasClass(n.SELECTED)}},ARIA_STATES:r,ARIA_ROLES:i,CLASS_NAMES:n}),e.Button=s,e.ToggleButton=o},"@VERSION@",{requires:["button-core","cssbutton","widget"]});
+YUI.add("button",function(e,t){function s(){s.superclass.constructor.apply(this,arguments)}function o(){s.superclass.constructor.apply(this,arguments)}var n=e.ButtonCore.CLASS_NAMES,r=e.ButtonCore.ARIA_STATES,i=e.ButtonCore.ARIA_ROLES;e.extend(s,e.Widget,{BOUNDING_TEMPLATE:e.ButtonCore.prototype.TEMPLATE,CONTENT_TEMPLATE:null,initializer:function(e){this._host=this.get("boundingBox"),e.disabled&&this.set("disabled",e.disabled)},bindUI:function(){var e=this;e.after("labelChange",e._afterLabelChange),e.after("disabledChange",e._afterDisabledChange)},syncUI:function(){var t=this;e.ButtonCore.prototype._uiSetLabel.call(t,t.get("label")),e.ButtonCore.prototype._uiSetDisabled.call(t,t.get("disabled"))},_afterLabelChange:function(t){e.ButtonCore.prototype._uiSetLabel.call(this,t.newVal)},_afterDisabledChange:function(t){e.ButtonCore.prototype._uiSetDisabled.call(this,t.newVal)}},{NAME:"button",ATTRS:{label:{value:e.ButtonCore.ATTRS.label.value}},HTML_PARSER:{label:function(e){return this._getLabelFromNode(e)},disabled:function(e){return e.getDOMNode().disabled}},CLASS_NAMES:n}),e.mix(s.prototype,e.ButtonCore.prototype),e.extend(o,s,{trigger:"click",selectedAttrName:"",initializer:function(e){var t=this,n=t.get("type"),r=n==="checkbox"?"checked":"pressed",i=e[r]||!1;t.addAttr(r,{value:i}),t.selectedAttrName=r},destructor:function(){delete this.selectedAttrName},bindUI:function(){var e=this,t=e.get("contentBox");o.superclass.bindUI.call(e),t.on(e.trigger,e.toggle,e),e.after(e.selectedAttrName+"Change",e._afterSelectedChange)},syncUI:function(){var e=this,t=e.get("contentBox"),n=e.get("type"),r=o.ARIA_ROLES,i=n==="checkbox"?r.CHECKBOX:r.TOGGLE,s=e.selectedAttrName;o.superclass.syncUI.call(e),t.set("role",i),e._uiSetSelected(e.get(s))},_afterSelectedChange:function(e){this._uiSetSelected(e.newVal)},_uiSetSelected:function(e){var t=this,n=t.get("contentBox"),r=o.ARIA_STATES,i=t.get("type"),u=i==="checkbox"?r.CHECKED:r.PRESSED;n.toggleClass(s.CLASS_NAMES.SELECTED,e),n.set(u,e)},toggle:function(){var e=this;e._set(e.selectedAttrName,!e.get(e.selectedAttrName))}},{NAME:"toggleButton",ATTRS:{type:{value:"toggle",writeOnce:"initOnly"}},HTML_PARSER:{checked:function(e){return e.hasClass(n.SELECTED)},pressed:function(e){return e.hasClass(n.SELECTED)}},ARIA_STATES:r,ARIA_ROLES:i,CLASS_NAMES:n}),e.Button=s,e.ToggleButton=o},"@VERSION@",{requires:["button-core","cssbutton","widget"]});
diff --git a/build/button/button.js b/build/button/button.js
index 8e18a6c6c0e..ee87e297e73 100644
--- a/build/button/button.js
+++ b/build/button/button.js
@@ -129,12 +129,11 @@ Y.extend(Button, Y.Widget, {
* @static
*/
ATTRS: {
-
/**
* The text of the button (the `value` or `text` property)
*
* @attribute label
- * @type String
+ * @type {HTML|String}
*/
label: {
value: Y.ButtonCore.ATTRS.label.value
@@ -149,8 +148,7 @@ Y.extend(Button, Y.Widget, {
*/
HTML_PARSER: {
label: function(node) {
- this._host = node; // TODO: remove
- return this._getLabel();
+ return this._getLabelFromNode(node);
},
disabled: function(node) {