]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu: Update default visual test, remove the disable/toggle buttons, that behaviour...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Fri, 18 May 2012 13:18:19 +0000 (15:18 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Fri, 18 May 2012 13:18:19 +0000 (15:18 +0200)
tests/visual/menu/menu.html

index ba4017e659c6281f0592933253174e5203fd7e82..b73588bcecc5fc3ff3446933c019a11102d42bb7 100644 (file)
                        top: 10
                }).appendTo(document.body).themeswitcher();
 
-               function create() {
-                       menus.menu({
-                               select: function(event, ui) {
-                                       $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
-                               }
-                       });
-
-                       $("#menu5").menu({
-                               select: function(event, ui) {
-                                       $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
-                               },
-                               menus: "div"
-                       });
-
-                       $("#menu6").menu({
-                               select: function(event, ui) {
-                                       $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
-                               },
-                               menus: ".menuElement"
-                       });
-               }
+               $("#menu1, #menu2, #menu3, .menu4").menu({
+                       select: function(event, ui) {
+                               $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
+                       }
+               });
 
-               var menus = $("#menu1, #menu2, #menu3, .menu4"),
-                       all = menus.add("#menu5, #menu6");
-               create();
+               $("#menu5").menu({
+                       select: function(event, ui) {
+                               $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
+                       },
+                       menus: "div"
+               });
 
-               $("#toggle-destroy").toggle(function() {
-                       all.menu("destroy");
-               }, create);
-               $("#toggle-disable").toggle(function() {
-                       all.menu("disable");
-               }, function() {
-                       all.menu("enable");
+               $("#menu6").menu({
+                       select: function(event, ui) {
+                               $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
+                       },
+                       menus: ".menuElement"
                });
        });
        </script>
        <div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
 </div>
 
-<button id="toggle-disable">Disable / Enable</button>
-<button id="toggle-destroy">Destroy / Create</button>
-
 </body>
 </html>
\ No newline at end of file