this.element = $(element)
.bind('setData.' + name, function(e, key, value) {
- return self.setData(key, value);
+ return self._setData(key, value);
})
.bind('getData.' + name, function(e, key) {
- return self.getData(key);
+ return self._getData(key);
})
.bind('remove', function() {
return self.destroy();
});
- this.init();
+ this._init();
};
// add widget prototype
};
$.widget.prototype = {
- init: function() {},
+ _init: function() {},
destroy: function() {
this.element.removeData(this.widgetName);
},
- getData: function(key) {
+ _getData: function(key) {
return this.options[key];
},
- setData: function(key, value) {
+ _setData: function(key, value) {
this.options[key] = value;
if (key == 'disabled') {
},
enable: function() {
- this.setData('disabled', false);
+ this._setData('disabled', false);
},
disable: function() {
- this.setData('disabled', true);
+ this._setData('disabled', true);
},
- trigger: function(type, e, data) {
+ _trigger: function(type, e, data) {
var eventName = (type == this.widgetEventPrefix
? type : this.widgetEventPrefix + type);
e = e || $.event.fix({ type: eventName, target: this.element[0] });