From 956697bfca1b386ae20eb27ccfd8c1df3234f1f2 Mon Sep 17 00:00:00 2001 From: Xavi Date: Sun, 19 Dec 2010 16:52:22 -0500 Subject: All: Use .toggleClass() instead of conditionally using .addClass() and .removeClass(). Fixes #6764 - Use toggleClass instead of [ bool ? 'addClass' : 'removeClass' ]. --- ui/jquery.ui.sortable.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ui/jquery.ui.sortable.js') 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); -- cgit v1.2.3