Navigation Menu

Skip to content

Commit

Permalink
Widget demo: Don't use .toggle(fn).
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgonzalez committed May 21, 2012
1 parent fb91d90 commit 24b7ff1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions demos/widget/default.html
Expand Up @@ -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
Expand Down

0 comments on commit 24b7ff1

Please sign in to comment.