]> source.dussan.org Git - jquery-ui.git/commitdiff
Revert "Widget: Stop setting ui-state-disabled and aria by default on setting disable...
authorScott González <scott.gonzalez@gmail.com>
Thu, 14 Mar 2013 19:07:06 +0000 (15:07 -0400)
committerScott González <scott.gonzalez@gmail.com>
Thu, 14 Mar 2013 19:07:06 +0000 (15:07 -0400)
This reverts commit 4d67f4f34908a50ef88f95df4103ee001b777e45.

23 files changed:
tests/unit/accordion/accordion_methods.js
tests/unit/autocomplete/autocomplete_options.js
tests/unit/button/button_options.js
tests/unit/dialog/dialog_methods.js
tests/unit/draggable/draggable_methods.js
tests/unit/droppable/droppable_methods.js
tests/unit/progressbar/progressbar_methods.js
tests/unit/resizable/resizable_methods.js
tests/unit/selectable/selectable_methods.js
tests/unit/slider/slider_methods.js
tests/unit/sortable/sortable_methods.js
tests/unit/spinner/spinner_methods.js
tests/unit/tabs/tabs_options.js
tests/unit/tooltip/tooltip_methods.js
ui/jquery.ui.accordion.js
ui/jquery.ui.button.js
ui/jquery.ui.droppable.js
ui/jquery.ui.menu.js
ui/jquery.ui.progressbar.js
ui/jquery.ui.slider.js
ui/jquery.ui.sortable.js
ui/jquery.ui.spinner.js
ui/jquery.ui.widget.js

index 7612479f7e38eea14e5adeaf2b60039168088a31..b1123b8284701b82b55803d4d2ae3bdc8783428f 100644 (file)
@@ -14,15 +14,10 @@ test( "destroy", function() {
 });
 
 test( "enable/disable", function() {
-       expect( 7 );
+       expect( 4 );
        var element = $( "#list1" ).accordion();
        state( element, 1, 0, 0 );
        element.accordion( "disable" );
-
-       ok( element.hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" );
-       equal( element.attr( "aria-disabled" ), "true", "element gets aria-disabled" );
-       ok( element.hasClass( "ui-accordion-disabled" ), "element gets ui-accordion-disabled" );
-
        // event does nothing
        element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "click" );
        state( element, 1, 0, 0 );
index c98f2c28e7c8bf291a290fb1b0b24f223c643f42..9f0bd2d43f211b6e6775655c9946c1eb56da66ac 100644 (file)
@@ -88,20 +88,17 @@ asyncTest( "delay", function() {
 });
 
 asyncTest( "disabled", function() {
-       expect( 5 );
+       expect( 2 );
        var element = $( "#autocomplete" ).autocomplete({
                        source: data,
-                       delay: 0
+                       delay: 0,
+                       disabled: true
                }),
-               menu = element.autocomplete( "disable" ).autocomplete( "widget" );
+               menu = element.autocomplete( "widget" );
        element.val( "ja" ).keydown();
 
        ok( menu.is( ":hidden" ) );
 
-       ok( !element.is( ".ui-state-disabled" ), "element doesn't get ui-state-disabled" );
-       ok( !element.attr( "aria-disabled" ), "element doesn't get aria-disabled" );
-       ok( menu.is( ".ui-autocomplete-disabled" ), "element gets ui-autocomplete-disabled" );
-
        setTimeout(function() {
                ok( menu.is( ":hidden" ) );
                start();
index 124a8699f6fd7ea859930b163b1a31501ddc489b..e1931a54e9c6b18b4c04e9e96768caa6663384b1 100644 (file)
@@ -3,26 +3,19 @@
  */
 (function($) {
 
-module( "button: options" );
+module("button: options");
 
-test( "disabled, explicit value", function() {
-       expect( 9 );
-
-       var element = $( "#radio01" ).button({ disabled: false });
-       deepEqual( element.button( "option", "disabled" ), false, "disabled option set to false" );
-       deepEqual( element.prop( "disabled" ), false, "element is disabled" );
-
-       ok( !element.button( "widget" ).hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" );
-       ok( !element.button( "widget" ).hasClass( "ui-button-disabled" ), "element gets ui-button-disabled" );
-
-       element = $( "#radio02" ).button({ disabled: true });
-
-       ok( element.button( "widget" ).hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" );
-       ok( !element.button( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
-       ok( element.button( "widget" ).hasClass( "ui-button-disabled" ), "element gets ui-button-disabled" );
+test("disabled, explicit value", function() {
+       expect( 4 );
+       $("#radio01").button({ disabled: false });
+       deepEqual(false, $("#radio01").button("option", "disabled"),
+               "disabled option set to false");
+       deepEqual(false, $("#radio01").prop("disabled"), "element is disabled");
 
-       deepEqual( element.button( "option", "disabled" ), true, "disabled option set to true" );
-       deepEqual( element.prop( "disabled" ), true, "element is not disabled" );
+       $("#radio02").button({ disabled: true });
+       deepEqual(true, $("#radio02").button("option", "disabled"),
+               "disabled option set to true");
+       deepEqual(true, $("#radio02").prop("disabled"), "element is not disabled");
 });
 
 test("disabled, null", function() {
index 2bb06ab465c14c234b9f6361e63d323c5b269a67..6de18551373fbd71b7bb66eb288ac57d5c121fe8 100644 (file)
@@ -101,13 +101,11 @@ test("#4980: Destroy should place element back in original DOM position", functi
 });
 
 test( "enable/disable disabled", function() {
-       expect( 4 );
+       expect( 2 );
        var element = $( "<div></div>" ).dialog();
        element.dialog( "disable" );
        equal(element.dialog( "option", "disabled" ), false, "disable method doesn't do anything" );
        ok( !element.dialog( "widget" ).hasClass( "ui-dialog-disabled" ), "disable method doesn't add ui-dialog-disabled class" );
-       ok( !element.dialog( "widget" ).hasClass( "ui-state-disabled" ), "disable method doesn't add ui-state-disabled class" );
-       ok( !element.dialog( "widget" ).attr( "aria-disabled" ), "disable method doesn't add aria-disabled" );
 });
 
 test("close", function() {
index 63a19e26d17ec37dd62dfa14555ed94271b4c627..901c261d6ed9ad7e126350a3badfeed5e760b9e6 100644 (file)
@@ -74,16 +74,16 @@ test( "enable", function() {
 });
 
 test( "disable", function() {
-       expect( 10 );
+       expect( 7 );
 
-       element = $( "#draggable2" ).draggable({ disabled: false });
+       element = $("#draggable2").draggable({ disabled: false });
        TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" );
 
-       element.draggable( "disable" );
+       element.draggable("disable");
        TestHelpers.draggable.shouldNotMove( element, ".draggable('disable')" );
        equal( element.draggable( "option", "disabled" ), true, "disabled option getter" );
 
-       element.draggable( "destroy" );
+       element.draggable("destroy");
        element.draggable({ disabled: false });
        TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" );
 
@@ -91,12 +91,8 @@ test( "disable", function() {
        equal( element.draggable( "option", "disabled" ), true, "disabled option setter" );
        TestHelpers.draggable.shouldNotMove( element, ".draggable('option', 'disabled', true)" );
 
-       ok( !element.draggable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" );
-       ok( !element.draggable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
-       ok( element.draggable( "widget" ).hasClass( "ui-draggable-disabled" ), "element gets ui-draggable-disabled" );
-
        var expected = element.draggable(),
-               actual = expected.draggable( "disable" );
+               actual = expected.draggable("disable");
        equal( actual, expected, "disable is chainable" );
 });
 
index f7682d262e4da804af311f7ce215a8c200af3640..2b452a63dfc3bd61ef646525439ee4b19948f54f 100644 (file)
@@ -63,29 +63,26 @@ test("enable", function() {
        equal(actual, expected, "enable is chainable");
 });
 
-test( "disable", function() {
-       expect( 10 );
+test("disable", function() {
+       expect(7);
 
-       var actual, expected,
-               element = $( "#droppable1" ).droppable({ disabled: false });
+       var el, actual, expected;
 
+       el = $("#droppable1").droppable({ disabled: false });
        TestHelpers.droppable.shouldDrop();
-       element.droppable( "disable" );
+       el.droppable("disable");
        TestHelpers.droppable.shouldNotDrop();
-       equal( element.droppable( "option", "disabled" ), true, "disabled option getter" );
-       element.droppable( "destroy" );
-       element.droppable({ disabled: false });
+       equal(el.droppable("option", "disabled"), true, "disabled option getter");
+       el.droppable("destroy");
+       el.droppable({ disabled: false });
        TestHelpers.droppable.shouldDrop();
-       element.droppable( "option", "disabled", true );
-       ok( !element.droppable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" );
-       ok( !element.droppable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
-       ok( element.droppable( "widget" ).hasClass( "ui-droppable-disabled" ), "element gets ui-droppable-disabled" );
-       equal( element.droppable( "option", "disabled" ), true, "disabled option setter" );
+       el.droppable("option", "disabled", true);
+       equal(el.droppable("option", "disabled"), true, "disabled option setter");
        TestHelpers.droppable.shouldNotDrop();
 
-       expected = $( "<div></div>" ).droppable();
-       actual = expected.droppable( "disable" );
-       equal( actual, expected, "disable is chainable" );
+       expected = $("<div></div>").droppable(),
+       actual = expected.droppable("disable");
+       equal(actual, expected, "disable is chainable");
 });
 
 })(jQuery);
index 004eacf90d290ed85850287b47bbdf8c6e8e428c..cf7faf6af817223ec84ba9e9210e64b3e4463ddd 100644 (file)
@@ -7,16 +7,6 @@ test( "destroy", function() {
        });
 });
 
-test( "disable", function() {
-       expect( 3 );
-
-       var element = $( "#progressbar" ).progressbar().progressbar( "disable" );
-
-       ok( element.progressbar( "widget" ).hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" );
-       ok( element.progressbar( "widget" ).attr( "aria-disabled" ), "element gets aria-disabled" );
-       ok( element.progressbar( "widget" ).hasClass( "ui-progressbar-disabled" ), "element gets ui-progressbar-disabled" );
-});
-
 test( "value", function() {
        expect( 3 );
 
index abb8951f930285c9cb4d7b9a65e186fc042c9712..b12f3035a2e4f2ec31c7935141604b813e618dd6 100644 (file)
@@ -3,19 +3,10 @@
  */
 (function($) {
 
-module( "resizable: methods" );
+module("resizable: methods");
 
-test( "disable", function() {
-       expect( 5 );
-
-       var element = $( "#resizable1" ).resizable({ disabled: false }),
-               chainable = element.resizable( "disable" );
-
-       ok( !element.resizable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" );
-       ok( !element.resizable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
-       ok( element.resizable( "widget" ).hasClass( "ui-resizable-disabled" ), "element gets ui-resizable-disabled" );
-       equal( element.resizable( "option", "disabled" ), true, "disabled option setter" );
-       equal( chainable, element, "disable is chainable" );
-});
+// this is here to make JSHint pass "unused", and we don't want to
+// remove the parameter for when we finally implement
+$.noop();
 
 })(jQuery);
index 179d4ecd6b6f70b3ad28fd8391340137e72deaa2..72f9bb28d73392a31090fa76f9dcd0ea916ee1aa 100644 (file)
@@ -71,40 +71,34 @@ test("enable", function() {
        equal(actual, expected, "enable is chainable");
 });
 
-test( "disable", function() {
-       expect( 6 );
-       var chainable,
+test("disable", function() {
+       expect(3);
+       var expected, actual,
                fired = false,
-               element = $( "#selectable1" );
+               el = $("#selectable1");
 
-       element.selectable({
+       el.selectable({
                disabled: false,
-               start: function() {
-                       fired = true;
-               }
+               start: function() { fired = true; }
        });
-       element.simulate( "drag", {
+       el.simulate( "drag", {
                dx: 20,
                dy: 20
        });
-       equal( fired, true, "start fired" );
-
-       chainable = element.selectable( "disable" );
+       equal(fired, true, "start fired");
+       el.selectable("disable");
        fired = false;
 
-       element.simulate( "drag", {
+       el.simulate( "drag", {
                dx: 20,
                dy: 20
        });
-       equal( fired, false, "start fired" );
-
-       ok( !element.selectable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" );
-       ok( !element.selectable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
-       ok( element.selectable( "widget" ).hasClass( "ui-selectable-disabled" ), "element gets ui-selectable-disabled" );
-
-       element.selectable( "destroy" );
+       equal(fired, false, "start fired");
+       el.selectable("destroy");
 
-       equal( chainable, element, "disable is chainable" );
+       expected = $("<div></div>").selectable();
+       actual = expected.selectable("disable");
+       equal(actual, expected, "disable is chainable");
 });
 
 })(jQuery);
index bd9023133961f04a44dc56343e285bd1a897d881..75df230a6461dfdc87f5cb8e4a88031e3179c4a0 100644 (file)
@@ -49,7 +49,7 @@ test( "enable", function() {
 });
 
 test( "disable", function() {
-       expect( 6 );
+       expect( 5 );
        var element,
                expected = $( "<div></div>" ).slider(),
                actual = expected.slider( "disable" );
@@ -61,7 +61,6 @@ test( "disable", function() {
        element.slider( "disable" );
        ok( element.hasClass( "ui-state-disabled" ), "slider has ui-state-disabled class after disable method call" );
        ok( element.hasClass( "ui-slider-disabled" ), "slider has ui-slider-disabled class after disable method call" );
-       ok( !element.attr( "aria-disabled" ), "slider does not have aria-disabled attr after disable method call" );
 });
 
 test( "value", function() {
index f3fe240e701635d7a373c14aa0d82b18fb2bd5c1..07a7bc77d63132d8925c42dfff21c2e556d58a3e 100644 (file)
@@ -64,30 +64,29 @@ test("enable", function() {
        equal(actual, expected, "enable is chainable");
 });
 
-test( "disable", function() {
-       expect( 9 );
+test("disable", function() {
+       expect(7);
 
-       var chainable,
-               element = $( "#sortable" ).sortable({ disabled: false });
-
-       TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" );
+       var el, actual, expected;
 
-       chainable = element.sortable( "disable" );
-       TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 0, "disabled.sortable getter" );
+       el = $("#sortable").sortable({ disabled: false });
+       TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable({ disabled: false })");
 
-       element.sortable( "destroy" );
+       el.sortable("disable");
+       TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, "disabled.sortable getter");
 
-       element.sortable({ disabled: false });
-       TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" );
-       element.sortable( "option", "disabled", true);
-       equal( element.sortable( "option", "disabled" ), true, "disabled option setter" );
+       el.sortable("destroy");
 
-       ok( !element.sortable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" );
-       ok( !element.sortable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
-       ok( element.sortable( "widget" ).hasClass( "ui-sortable-disabled" ), "element gets ui-sortable-disabled" );
+       el.sortable({ disabled: false });
+       TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable({ disabled: false })");
+       el.sortable("option", "disabled", true);
+       equal(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");
+       TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, ".sortable('option', 'disabled', true)");
 
-       TestHelpers.sortable.sort($( "li", element )[ 0 ], 0, 44, 0, ".sortable('option', 'disabled', true)" );
-       equal( chainable, element, "disable is chainable" );
+       expected = $("<div></div>").sortable(),
+       actual = expected.sortable("disable");
+       equal(actual, expected, "disable is chainable");
 });
 
 })(jQuery);
index 4f44a73aef12233999fa60d2f69deb8245e2b200..af872f25763539b1eb229c0d9c55e56e6f21c413 100644 (file)
@@ -12,7 +12,7 @@ test( "destroy", function() {
 });
 
 test( "disable", function() {
-       expect( 16 );
+       expect( 14 );
        var element = $( "#spin" ).val( 2 ).spinner(),
                wrapper = $( "#spin" ).spinner( "widget" );
 
@@ -21,8 +21,6 @@ test( "disable", function() {
 
        element.spinner( "disable" );
        ok( wrapper.hasClass( "ui-spinner-disabled" ), "after: wrapper has ui-spinner-disabled class" );
-       ok( wrapper.hasClass( "ui-state-disabled" ), "after: wrapper has ui-state-disabled class" );
-       ok( !wrapper.attr( "aria-disabled" ), "after: wrapper does not have aria-disabled attr" );
        ok( element.is( ":disabled"), "after: input has disabled attribute" );
 
        simulateKeyDownUp( element, $.ui.keyCode.UP );
index 02a2fea343ed73d24ef9cb1cddb20fe9b9655eaf..c78c42b58106522157ce8b1da9786c0c47f728db 100644 (file)
@@ -144,40 +144,24 @@ test( "{ collapsible: true }", function() {
 });
 
 test( "disabled", function() {
-       expect( 22 );
+       expect( 10 );
 
        // fully enabled by default
        var element = $( "#tabs1" ).tabs();
        disabled( element, false );
 
-       ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" );
-       ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" );
-       ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" );
-
        // disable single tab
        element.tabs( "option", "disabled", [ 1 ] );
        disabled( element, [ 1 ] );
 
-       ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" );
-       ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" );
-       ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" );
-
        // disabled active tab
        element.tabs( "option", "disabled", [ 0, 1 ] );
        disabled( element, [ 0, 1 ] );
 
-       ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" );
-       ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" );
-       ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" );
-
        // disable all tabs
        element.tabs( "option", "disabled", [ 0, 1, 2 ] );
        disabled( element, true );
 
-       ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" );
-       ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" );
-       ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" );
-
        // enable all tabs
        element.tabs( "option", "disabled", [] );
        disabled( element, false );
index a557ff943a217ede5147e0110e2425edc99fea27..c846d216cd43f6bae64da1762371ea801eaee441 100644 (file)
@@ -54,7 +54,7 @@ test( "open/close with tracking", function() {
 });
 
 test( "enable/disable", function() {
-       expect( 10 );
+       expect( 7 );
        $.fx.off = true;
        var tooltip,
                element = $( "#tooltipped1" ).tooltip();
@@ -66,11 +66,6 @@ test( "enable/disable", function() {
 
        element.tooltip( "disable" );
        equal( $( ".ui-tooltip" ).length, 0, "no tooltip when disabled" );
-
-       ok( !element.tooltip( "widget" ).hasClass( "ui-state-disabled" ), "element doesn't get ui-state-disabled" );
-       ok( !element.tooltip( "widget" ).attr( "aria-disabled" ), "element doesn't get aria-disabled" );
-       ok( !element.tooltip( "widget" ).hasClass( "ui-tooltip-disabled" ), "element doesn't get ui-tooltip-disabled" );
-
        // support: jQuery <1.6.2
        // support: IE <8
        // We should use strictEqual( ..., undefined ) when dropping jQuery 1.6.1 support (or IE6/7)
index da0d5751c44f7c323ad16d10c460ebc1be8b6453..1afa95cb4b0071108280dea8846a287c2db7c4af 100644 (file)
@@ -161,9 +161,6 @@ $.widget( "ui.accordion", {
                // #5332 - opacity doesn't cascade to positioned elements in IE
                // so we need to add the disabled class to the headers and panels
                if ( key === "disabled" ) {
-                       this.element
-                               .toggleClass( "ui-state-disabled", !!value )
-                               .attr( "aria-disabled", value );
                        this.headers.add( this.headers.next() )
                                .toggleClass( "ui-state-disabled", !!value );
                }
index 5e64f5164c9d606b64b7bd25f2cc05550024f7bc..fcb7b14d18799751a3052256b0e5aa136911d4a3 100644 (file)
@@ -207,6 +207,9 @@ $.widget( "ui.button", {
                        }
                }
 
+               // TODO: pull out $.Widget's handling for the disabled option into
+               // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can
+               // be overridden by individual plugins
                this._setOption( "disabled", options.disabled );
                this._resetButton();
        },
@@ -270,8 +273,11 @@ $.widget( "ui.button", {
        _setOption: function( key, value ) {
                this._super( key, value );
                if ( key === "disabled" ) {
-                       this.widget().toggleClass( "ui-state-disabled", !!value );
-                       this.element.prop( "disabled", !!value );
+                       if ( value ) {
+                               this.element.prop( "disabled", true );
+                       } else {
+                               this.element.prop( "disabled", false );
+                       }
                        return;
                }
                this._resetButton();
index 34342d33d42ac9cded5c6a2fca21e222450e4c90..552b24a5850eb31e1cff2a542f34751a9448c122 100644 (file)
@@ -82,7 +82,7 @@ $.widget("ui.droppable", {
                                return d.is(value);
                        };
                }
-               this._super( key, value );
+               $.Widget.prototype._setOption.apply(this, arguments);
        },
 
        _activate: function(event) {
index bdef9324804a10469ad4e1f55bb10a78426bdeab..1c633786d9a1493c4f1e8f5cd4135594ef29dd61 100644 (file)
@@ -350,11 +350,6 @@ $.widget( "ui.menu", {
                                .removeClass( this.options.icons.submenu )
                                .addClass( value.submenu );
                }
-               if ( key === "disabled" ) {
-                       this.element
-                               .toggleClass( "ui-state-disabled", !!value )
-                               .attr( "aria-disabled", value );
-               }
                this._super( key, value );
        },
 
index 0eaa8b41ec6c853258e78b353d8df46c7270419b..9e959ebc4cbd1991c0454f0076d675b992c92f68 100644 (file)
@@ -97,11 +97,7 @@ $.widget( "ui.progressbar", {
                        // Don't allow a max less than min
                        value = Math.max( this.min, value );
                }
-               if ( key === "disabled" ) {
-                       this.element
-                               .toggleClass( "ui-state-disabled", !!value )
-                               .attr( "aria-disabled", value );
-               }
+
                this._super( key, value );
        },
 
index 88281240dcbe77d6de035de84c0b47dca6bf5656..b3e609aa2342726bb1cde760a33060ed219dc933 100644 (file)
@@ -427,11 +427,7 @@ $.widget( "ui.slider", $.ui.mouse, {
                        valsLength = this.options.values.length;
                }
 
-               if ( key === "disabled" ) {
-                       this.element.toggleClass( "ui-state-disabled", !!value );
-               }
-
-               this._super( key, value );
+               $.Widget.prototype._setOption.apply( this, arguments );
 
                switch ( key ) {
                        case "orientation":
index 642d5d9479c156875f9d927fedb4efec62f8510c..efc83f3d5931fc4175617aceb0fb9004312635bd 100644 (file)
@@ -102,6 +102,17 @@ $.widget("ui.sortable", $.ui.mouse, {
                return this;
        },
 
+       _setOption: function(key, value){
+               if ( key === "disabled" ) {
+                       this.options[ key ] = value;
+
+                       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);
+               }
+       },
+
        _mouseCapture: function(event, overrideHandle) {
                var currentItem = null,
                        validHandle = false,
index c022413dc2435de2279661e69530486c9ee35584..644b652395a413bc1d2a8a3daa35f59146ffb674 100644 (file)
@@ -381,9 +381,13 @@ $.widget( "ui.spinner", {
                this._super( key, value );
 
                if ( key === "disabled" ) {
-                       this.widget().toggleClass( "ui-state-disabled", !!value );
-                       this.element.prop( "disabled", !!value );
-                       this.buttons.button( value ? "disable" : "enable" );
+                       if ( value ) {
+                               this.element.prop( "disabled", true );
+                               this.buttons.button( "disable" );
+                       } else {
+                               this.element.prop( "disabled", false );
+                               this.buttons.button( "enable" );
+                       }
                }
        },
 
index adc4b9da1bf884bc2097f7e228d9d30179b25f73..c581e4b81567911211352d6f0208a1898570cc51 100644 (file)
@@ -345,7 +345,8 @@ $.Widget.prototype = {
 
                if ( key === "disabled" ) {
                        this.widget()
-                               .toggleClass( this.widgetFullName + "-disabled", !!value );
+                               .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
+                               .attr( "aria-disabled", value );
                        this.hoverable.removeClass( "ui-state-hover" );
                        this.focusable.removeClass( "ui-state-focus" );
                }