aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.widget.js
diff options
context:
space:
mode:
authorXavi <xavi.rmz@gmail.com>2010-12-19 16:52:22 -0500
committerScott González <scott.gonzalez@gmail.com>2010-12-19 16:52:22 -0500
commit956697bfca1b386ae20eb27ccfd8c1df3234f1f2 (patch)
treef246a4e7ea861a3bbc1939f758489e9febfbdb9d /ui/jquery.ui.widget.js
parentd6edba5a89ab5e84044666bb9d50a4663c1412c8 (diff)
downloadjquery-ui-956697bfca1b386ae20eb27ccfd8c1df3234f1f2.tar.gz
jquery-ui-956697bfca1b386ae20eb27ccfd8c1df3234f1f2.zip
All: Use .toggleClass() instead of conditionally using .addClass() and .removeClass(). Fixes #6764 - Use toggleClass instead of [ bool ? 'addClass' : 'removeClass' ].
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r--ui/jquery.ui.widget.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index 0420bc31a..b5fb600d9 100644
--- a/ui/jquery.ui.widget.js
+++ b/ui/jquery.ui.widget.js
@@ -212,9 +212,7 @@ $.Widget.prototype = {
if ( key === "disabled" ) {
this.widget()
- [ value ? "addClass" : "removeClass"](
- this.widgetBaseClass + "-disabled" + " " +
- "ui-state-disabled" )
+ .toggleClass( this.widgetBaseClass + "-disabled ui-state-disabled", !!value )
.attr( "aria-disabled", value );
}