}
cfg.html = this.html || cfg.html;
- if (this.toggle === true) {
+ if (this.toggle == true) {
cfg={
tag: 'div',
cls: 'slider-frame roo-button',
this.disabled = true;
this.el.addClass('disabled');
},
- toggle : function(v) {
- this[v ? 'enable' : 'disable']();
+ /**
+ * sets the active state on/off,
+ * @param {Boolean} state (optional) Force a particular state
+ */
+ setActive : function(v) {
+ this.el[v ? 'addClass' : 'removeClass']('active');
+
+
+ },
+ /**
+ * If a state it passed, it becomes the pressed state otherwise the current state is toggled.
+ * @param {Boolean} state (optional) Force a particular state
+ */
+ toggleActive : function(v)
+ {
+ var active = this.el.hasClass('active');
+ this.setActive(!active);
+
}
+
+
+
});
\ No newline at end of file