diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-05-21 10:11:01 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-05-21 10:11:01 -0400 |
commit | 24b7ff1f177fae920750de1ae0272164cd6a1094 (patch) | |
tree | 7c1f1cc43896b5ee2066751a5017d2a1f8c22b4a /demos/widget | |
parent | fb91d90058175d6b38622393283603737b86e849 (diff) | |
download | jquery-ui-24b7ff1f177fae920750de1ae0272164cd6a1094.tar.gz jquery-ui-24b7ff1f177fae920750de1ae0272164cd6a1094.zip |
Widget demo: Don't use .toggle(fn).
Diffstat (limited to 'demos/widget')
-rw-r--r-- | demos/widget/default.html | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/demos/widget/default.html b/demos/widget/default.html index ece81218a..f39825034 100644 --- a/demos/widget/default.html +++ b/demos/widget/default.html @@ -139,11 +139,14 @@ }); // click to toggle enabled/disabled - $( "#disable" ).toggle(function() { + $( "#disable" ).click(function() { // use the custom selector created for each widget to find all instances - $( ":custom-colorize" ).colorize( "disable" ); - }, function() { - $( ":custom-colorize" ).colorize( "enable" ); + // all instances are toggled together, so we can check the state from the first + if ( $( ":custom-colorize" ).colorize( "option", "disabled" ) ) { + $( ":custom-colorize" ).colorize( "enable" ); + } else { + $( ":custom-colorize" ).colorize( "disable" ); + } }); // click to set options after initalization |