});
test("disable", function() {
- expect(6);
+ expect(7);
el = $("#sortable").sortable({ disabled: false });
sort($("li", el)[0], 0, 40, 2, '.sortable({ disabled: false })');
sort($("li", el)[0], 0, 40, 2, '.sortable({ disabled: false })');
el.sortable("option", "disabled", true);
equals(el.sortable("option", "disabled"), true, "disabled option setter");
+ ok(el.sortable("widget").is(":not(.ui-state-disabled)"), "sortable element does not get ui-state-disabled since it's an interaction");
sort($("li", el)[0], 0, 40, 0, '.sortable("option", "disabled", true)');
var expected = $('<div></div>').sortable(),
return this;
},
+ _setOption: function(key, value){
+ if ( key === "disabled" ) {
+ this.options[ key ] = value;
+
+ this.widget()
+ [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" );
+ } else {
+ // Don't call widget base _setOption for disable as it adds ui-state-disabled class
+ $.Widget.prototype._setOption.apply(self, arguments);
+ }
+ },
+
_mouseCapture: function(event, overrideHandle) {
if (this.reverting) {