projects
/
roojs1
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e502f51
)
Roo/bootstrap/Button.js
author
Alan Knowles
<alan@roojs.com>
Fri, 16 May 2014 08:29:43 +0000
(16:29 +0800)
committer
Alan Knowles
<alan@roojs.com>
Fri, 16 May 2014 08:29:43 +0000
(16:29 +0800)
Roo/bootstrap/Button.js
patch
|
blob
|
history
diff --git
a/Roo/bootstrap/Button.js
b/Roo/bootstrap/Button.js
index
25b46dd
..
da96380
100644
(file)
--- a/
Roo/bootstrap/Button.js
+++ b/
Roo/bootstrap/Button.js
@@
-302,12
+302,30
@@
Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, {
this.disabled = true;
this.el.addClass('disabled');
},
this.disabled = true;
this.el.addClass('disabled');
},
+ /**
+ * sets the active state on/off,
+ * @param {Boolean} state (optional) Force a particular state
+ */
setActive : function(v) {
this.el[v ? 'addClass' : 'removeClass']('active');
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
});
\ No newline at end of file