aboutsummaryrefslogtreecommitdiffstats
path: root/demos/spinner
diff options
context:
space:
mode:
Diffstat (limited to 'demos/spinner')
-rw-r--r--demos/spinner/default.html22
1 files changed, 13 insertions, 9 deletions
diff --git a/demos/spinner/default.html b/demos/spinner/default.html
index 03ae2ad7d..1827724b9 100644
--- a/demos/spinner/default.html
+++ b/demos/spinner/default.html
@@ -14,16 +14,20 @@
<script>
$(function() {
var spinner = $( "#spinner" ).spinner();
-
- $( "#disable" ).toggle(function() {
- spinner.spinner( "disable" );
- }, function() {
- spinner.spinner( "enable" );
+
+ $( "#disable" ).click(function() {
+ if ( spinner.spinner( "option", "disabled" ) ) {
+ spinner.spinner( "enable" );
+ } else {
+ spinner.spinner( "disable" );
+ }
});
- $( "#destroy" ).toggle(function() {
- spinner.spinner( "destroy" );
- }, function() {
- spinner.spinner();
+ $( "#destroy" ).click(function() {
+ if ( spinner.data( "ui-spinner" ) ) {
+ spinner.spinner( "destroy" );
+ } else {
+ spinner.spinner();
+ }
});
$( "#getvalue" ).click(function() {
alert( spinner.spinner( "value" ) );