Skip to content

Commit cfaddbf

Browse files
committed
Widget demo: Some more inline comments
1 parent 92e3786 commit cfaddbf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

demos/widget/default.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,32 @@
8888
}
8989
});
9090

91+
// initialize with default options
9192
$( '#my-widget1' ).colorize();
93+
94+
// initialize with two customized options
9295
$( '#my-widget2' ).colorize({
9396
red: 60,
9497
blue: 60
9598
});
99+
100+
// initialize with custom green value
101+
// and a random callback to allow only colors with enough green
96102
$( '#my-widget3' ).colorize( {
97103
green: 128,
98104
random: function( event, ui ) {
99105
return ui.green > 128;
100106
}
101107
});
102108

109+
// click to toggle enabled/disabled
103110
$( '#disable' ).toggle(function() {
104111
$( ':custom-colorize' ).colorize( 'disable' );
105112
}, function() {
106113
$( ':custom-colorize' ).colorize( 'enable' );
107114
});
108115

116+
// click to set options after initalization
109117
$( '#black' ).click( function() {
110118
$( ':custom-colorize' ).colorize( 'option', {
111119
red: 0,

0 commit comments

Comments
 (0)