button-debug.js revision d35783d338067103badd5ebbb57676c129f5e563
function ButtonWidget(config) {
}
initializer: function(config) {
},
CONTENT_TEMPLATE: null,
bindUI: function() {
},
_uiSetSelected: function(value) {
this.get('contentBox').toggleClass('yui3-button-selected', value).set('aria-pressed', value); // TODO should support aria-checked (if applicable)
},
_afterLabelChange: function(e) {
this._uiSetLabel(e.newVal);
},
_afterDisabledChange: function(e) {
this._uiSetDisabled(e.newVal);
},
_afterSelectedChange: function(e) {
this._uiSetSelected(e.newVal);
},
syncUI: function() {
}
}, {
NAME: 'button'
});
ButtonWidget.ATTRS = {
label: {
},
disabled: {
value: false
},
selected: {
value: false
}
};
return this._uiGetLabel();
},
},
}
};
function ToggleButton(config) {
}
// TODO: move to ButtonCore subclass to enable toggle plugin, widget, etc.
trigger: 'click',
select: function() {
this.set('selected', true);
},
unselect: function() {
this.set('selected', false);
},
toggle: function() {
var button = this;
},
bindUI: function() {
var button = this;
}
}, {
NAME: 'toggleButton'
});
// Export
Y.Button = ButtonWidget;
Y.ToggleButton = ToggleButton;