button-min.js revision a22e94e50e241a5ae089c072604fec309a0db44e
YUI.add("button",function(e){var c=e.ButtonCore.CLASS_NAMES,a=e.ButtonCore.ARIA_STATES,f=e.ButtonCore.ARIA_ROLES;function b(g){b.superclass.constructor.apply(this,arguments);}e.extend(b,e.Widget,{BOUNDING_TEMPLATE:e.ButtonCore.prototype.TEMPLATE,CONTENT_TEMPLATE:null,initializer:function(g){this._host=this.get("boundingBox");},bindUI:function(){var g=this;g.after("labelChange",g._afterLabelChange);g.after("disabledChange",g._afterDisabledChange);},syncUI:function(){var g=this;g._setLabel(g.get("label"));g._setDisabled(g.get("disabled"));},_afterLabelChange:function(g){this._setLabel(g.newVal);},_afterDisabledChange:function(g){this._setDisabled(g.newVal);}},{NAME:"button",ATTRS:{label:{value:e.ButtonCore.ATTRS.label.value},disabled:{value:false}},HTML_PARSER:{label:function(g){this._host=g;return this._getLabel();},disabled:function(g){return g.getDOMNode().disabled;}},CLASS_NAMES:c});e.mix(b.prototype,e.ButtonCore.prototype);function d(g){b.superclass.constructor.apply(this,arguments);}e.extend(d,b,{trigger:"click",initializer:function(h){var j=this,k=j.get("type"),i=(k==="checkbox"?"checked":"pressed"),g=h[i]||false;j.addAttr(i,{value:g,setter:"_setSelected",getter:"_getSelected"});j.after("selectedChange",j._afterSelectedChange);j._set("selected",g);},bindUI:function(){var h=this,g=h.get("contentBox"),j=this.get("type"),i=d.ARIA_ROLES,k=(j==="checkbox"?i.CHECKBOX:i.TOGGLE);d.superclass.bindUI.call(h);g.set("role",k);g.on(h.trigger,h.toggle,h);},syncUI:function(){d.superclass.syncUI.call(this);},_setSelected:function(h){var g=d.ARIA_STATES;if(this.get("type")==="checkbox"){ariaState=g.CHECKED;}else{ariaState=g.PRESSED;}this.get("contentBox").toggleClass(b.CLASS_NAMES.SELECTED,h).set(ariaState,h);},_getSelected:function(g){return this.get("contentBox").hasClass(b.CLASS_NAMES.SELECTED);},_afterSelectedChange:function(g){this._setSelected(g.newVal);},toggle:function(){var g=this;g._set("selected",!g.get("selected"));}},{NAME:"toggleButton",ATTRS:{type:{value:"toggle",writeOnce:"initOnly"},selected:{value:false,readOnly:true}},HTML_PARSER:{selected:function(g){return g.hasClass(c.SELECTED);}},ARIA_STATES:a,ARIA_ROLES:f,CLASS_NAMES:c});e.Button=b;e.ToggleButton=d;},"@VERSION@",{requires:["button-core","cssbutton","widget"]});