diff options
author | Felix Nagel <info@felixnagel.com> | 2012-05-24 18:34:32 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2012-05-24 18:34:32 +0200 |
commit | b30184d885329317b9dbd70835d2c4d154f98475 (patch) | |
tree | 445acc2481e8456211c3e893e7789fe4b5978791 /demos | |
parent | ec6d88fae464ffb432df6c8d2ed06ee9fa5b4dae (diff) | |
parent | a1f604eb453208c80ec17c42c7bb4e3a1c624102 (diff) | |
download | jquery-ui-b30184d885329317b9dbd70835d2c4d154f98475.tar.gz jquery-ui-b30184d885329317b9dbd70835d2c4d154f98475.zip |
Merge with master
Diffstat (limited to 'demos')
-rw-r--r-- | demos/accordion/custom-icons.html | 10 | ||||
-rw-r--r-- | demos/animate/default.html | 11 | ||||
-rw-r--r-- | demos/autocomplete/combobox.html | 8 | ||||
-rw-r--r-- | demos/button/default.html | 4 | ||||
-rw-r--r-- | demos/position/default.html | 2 | ||||
-rw-r--r-- | demos/progressbar/animated.html | 2 | ||||
-rw-r--r-- | demos/spinner/default.html | 22 | ||||
-rw-r--r-- | demos/tabs/manipulation.html | 4 | ||||
-rw-r--r-- | demos/toggle/default.html | 33 | ||||
-rw-r--r-- | demos/widget/default.html | 11 |
10 files changed, 66 insertions, 41 deletions
diff --git a/demos/accordion/custom-icons.html b/demos/accordion/custom-icons.html index 54716d9a0..02344bd12 100644 --- a/demos/accordion/custom-icons.html +++ b/demos/accordion/custom-icons.html @@ -19,10 +19,12 @@ $( "#accordion" ).accordion({ icons: icons }); - $( "#toggle" ).button().toggle(function() { - $( "#accordion" ).accordion( "option", "icons", null ); - }, function() { - $( "#accordion" ).accordion( "option", "icons", icons ); + $( "#toggle" ).button().click(function() { + if ( $( "#accordion" ).accordion( "option", "icons" ) ) { + $( "#accordion" ).accordion( "option", "icons", null ); + } else { + $( "#accordion" ).accordion( "option", "icons", icons ); + } }); }); </script> diff --git a/demos/animate/default.html b/demos/animate/default.html index 4fec428e7..307d030a6 100644 --- a/demos/animate/default.html +++ b/demos/animate/default.html @@ -15,22 +15,23 @@ </style> <script> $(function() { - $( "#button" ).toggle( - function() { + var state = true; + $( "#button" ).click(function() { + if ( state ) { $( "#effect" ).animate({ backgroundColor: "#aa0000", color: "#fff", width: 500 }, 1000 ); - }, - function() { + } else { $( "#effect" ).animate({ backgroundColor: "#fff", color: "#000", width: 240 }, 1000 ); } - ); + state = !state; + }); }); </script> </head> diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html index e2ef40dd9..051d55e45 100644 --- a/demos/autocomplete/combobox.html +++ b/demos/autocomplete/combobox.html @@ -18,7 +18,7 @@ position: relative; display: inline-block; } - .ui-button { + .ui-combobox-toggle { position: absolute; top: 0; bottom: 0; @@ -28,7 +28,7 @@ *height: 1.7em; *top: 0.1em; } - .ui-autocomplete-input { + .ui-combobox-input { margin: 0; padding: 0.3em; } @@ -75,7 +75,7 @@ .appendTo( wrapper ) .val( value ) .attr( "title", "" ) - .addClass( "ui-state-default" ) + .addClass( "ui-state-default ui-combobox-input" ) .autocomplete({ delay: 0, minLength: 0, @@ -128,7 +128,7 @@ text: false }) .removeClass( "ui-corner-all" ) - .addClass( "ui-corner-right ui-button-icon" ) + .addClass( "ui-corner-right ui-combobox-toggle" ) .click(function() { // close if already visible if ( input.autocomplete( "widget" ).is( ":visible" ) ) { diff --git a/demos/button/default.html b/demos/button/default.html index 60d2674c0..90369f816 100644 --- a/demos/button/default.html +++ b/demos/button/default.html @@ -11,7 +11,7 @@ <link rel="stylesheet" href="../demos.css"> <script> $(function() { - $( "input:submit, a, button", ".demo" ).button(); + $( "input[type=submit], a, button", ".demo" ).button(); $( "a", ".demo" ).click(function() { return false; }); }); </script> @@ -22,7 +22,7 @@ <button>A button element</button> -<input type="submit" value="A submit button"/> +<input type="submit" value="A submit button"> <a href="#">An anchor</a> diff --git a/demos/position/default.html b/demos/position/default.html index 01137be62..35004b993 100644 --- a/demos/position/default.html +++ b/demos/position/default.html @@ -55,7 +55,7 @@ $( ".positionable" ).css( "opacity", 0.5 ); - $( ":input" ).bind( "click keyup change", position ); + $( "select, input" ).bind( "click keyup change", position ); $( "#parent" ).draggable({ drag: position diff --git a/demos/progressbar/animated.html b/demos/progressbar/animated.html index c8f5ff551..6134a8ca7 100644 --- a/demos/progressbar/animated.html +++ b/demos/progressbar/animated.html @@ -10,7 +10,7 @@ <script src="../../ui/jquery.ui.progressbar.js"></script> <link rel="stylesheet" href="../demos.css"> <style> - .ui-progressbar-value { background-image: url(images/pbar-ani.gif); } + .ui-progressbar .ui-progressbar-value { background-image: url(images/pbar-ani.gif); } </style> <script> $(function() { 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" ) ); diff --git a/demos/tabs/manipulation.html b/demos/tabs/manipulation.html index 205fc2e4d..085d42c43 100644 --- a/demos/tabs/manipulation.html +++ b/demos/tabs/manipulation.html @@ -76,8 +76,8 @@ // close icon: removing the tab on click $( "#tabs span.ui-icon-close" ).live( "click", function() { - $( this ).closest( "li" ).remove(); - $( "#" + $( this ).prev().attr( "aria-controls" ) ).remove(); + var panelId = $( this ).closest( "li" ).remove().attr( "aria-controls" ); + $( "#" + panelId ).remove(); tabs.tabs( "refresh" ); }); }); diff --git a/demos/toggle/default.html b/demos/toggle/default.html index 469674b70..5dcd5eff8 100644 --- a/demos/toggle/default.html +++ b/demos/toggle/default.html @@ -1,4 +1,4 @@ -<!DOCTYPE html> +<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> @@ -19,18 +19,33 @@ <script src="../../ui/jquery.effects.slide.js"></script> <link rel="stylesheet" href="../demos.css"> <style> - .toggler { width: 500px; height: 200px; } - #button { padding: .5em 1em; text-decoration: none; } - #effect { width: 240px; height: 135px; padding: 0.4em; position: relative; } - #effect h3 { margin: 0; padding: 0.4em; text-align: center; } + .toggler { + width: 500px; + height: 200px; + } + #button { + padding: .5em 1em; + text-decoration: none; + } + #effect { + position: relative; + width: 240px; + height: 135px; + padding: 0.4em; + } + #effect h3 { + margin: 0; + padding: 0.4em; + text-align: center; + } </style> <script> $(function() { // run the currently selected effect function runEffect() { - // get effect type from + // get effect type from var selectedEffect = $( "#effectTypes" ).val(); - + // most effect types need no options passed by default var options = {}; // some effects have required parameters @@ -39,11 +54,11 @@ } else if ( selectedEffect === "size" ) { options = { to: { width: 200, height: 60 } }; } - + // run the effect $( "#effect" ).toggle( selectedEffect, options, 500 ); }; - + // set effect from select menu value $( "#button" ).click(function() { runEffect(); 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 |