acbf78fbb0e5ea3c5353314fcbaa6b7e3b82ad7cDerek Gathright* A Button Plugin
acbf78fbb0e5ea3c5353314fcbaa6b7e3b82ad7cDerek Gathright* @module button-plugin
acbf78fbb0e5ea3c5353314fcbaa6b7e3b82ad7cDerek Gathright* @since 3.5.0
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright* @class ButtonPlugin
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright* @param config {Object} Configuration object
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright* @constructor
06c1e33a270f80929bf9b9dde81f4061d1949fffDerek Gathright ButtonPlugin.superclass.constructor.apply(this, arguments);
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @method _afterNodeGet
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @param name {string}
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright // TODO: point to method (_uiSetLabel, etc) instead of getter/setter
06c1e33a270f80929bf9b9dde81f4061d1949fffDerek Gathright fn = ATTRS[name] && ATTRS[name].getter && this[ATTRS[name].getter];
06c1e33a270f80929bf9b9dde81f4061d1949fffDerek Gathright return new Y.Do.AlterReturn('get ' + name, fn.call(this));
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @method _afterNodeSet
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @param name {String}
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @param val {String}
06c1e33a270f80929bf9b9dde81f4061d1949fffDerek Gathright fn = ATTRS[name] && ATTRS[name].setter && this[ATTRS[name].setter];
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @method _initNode
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @param config {Object}
06c1e33a270f80929bf9b9dde81f4061d1949fffDerek Gathright Y.Do.after(this._afterNodeGet, node, 'get', this);
06c1e33a270f80929bf9b9dde81f4061d1949fffDerek Gathright Y.Do.after(this._afterNodeSet, node, 'set', this);
acbf78fbb0e5ea3c5353314fcbaa6b7e3b82ad7cDerek Gathright * @method destroy
acbf78fbb0e5ea3c5353314fcbaa6b7e3b82ad7cDerek Gathright // Nothing to do, but things are happier with it here
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * Attribute configuration.
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @property ATTRS
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @type {Object}
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * Name of this component.
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @property NAME
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @type String
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * Namespace of this component.
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @property NS
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright * @type String
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright* @method createNode
acbf78fbb0e5ea3c5353314fcbaa6b7e3b82ad7cDerek Gathright* @description A factory that plugs a Y.Node instance with Y.Plugin.Button
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright* @param node {Object}
d0f9ee99aee2d631a24062cd95d30c1d6955fc0fDerek Gathright* @param config {Object}
acbf78fbb0e5ea3c5353314fcbaa6b7e3b82ad7cDerek Gathright* @returns {Object} A plugged Y.Node instance
06c1e33a270f80929bf9b9dde81f4061d1949fffDerek GathrightButtonPlugin.createNode = function(node, config) {
06c1e33a270f80929bf9b9dde81f4061d1949fffDerek Gathright if (! (node.nodeType || node.getDOMNode || typeof node == 'string')) {
c857ea22eae75f7e285a2c5e626131e7be23e12cEric Ferraiuolo template = config.template || Y.Plugin.Button.prototype.TEMPLATE;
c857ea22eae75f7e285a2c5e626131e7be23e12cEric Ferraiuolo node = node || config.srcNode || Y.DOM.create(template);
06c1e33a270f80929bf9b9dde81f4061d1949fffDerek Gathright return Y.one(node).plug(Y.Plugin.Button, config);
d35783d338067103badd5ebbb57676c129f5e563Eric Ferraiuolo}, '@VERSION@' ,{requires:['button-core', 'cssbutton', 'node-pluginhost']});