aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.sortable.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.sortable.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.sortable.js')
-rw-r--r--ui/jquery.ui.sortable.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js
index d2d3228ee..32757d41c 100644
--- a/ui/jquery.ui.sortable.js
+++ b/ui/jquery.ui.sortable.js
@@ -77,8 +77,7 @@ $.widget("ui.sortable", $.ui.mouse, {
if ( key === "disabled" ) {
this.options[ key ] = value;
- this.widget()
- [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" );
+ this.widget().toggleClass( "ui-sortable-disabled", !!value );
} else {
// Don't call widget base _setOption for disable as it adds ui-state-disabled class
$.Widget.prototype._setOption.apply(this, arguments);