]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu visual tests: cleanup.
authorScott González <scott.gonzalez@gmail.com>
Fri, 18 May 2012 14:40:44 +0000 (10:40 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 18 May 2012 14:40:44 +0000 (10:40 -0400)
tests/visual/menu/menu.html

index b73588bcecc5fc3ff3446933c019a11102d42bb7..f92de61dbc61725dab9b75160ed90ee68959fe39 100644 (file)
@@ -3,39 +3,30 @@
 <head>
        <meta charset="utf-8">
        <title>Menu Visual Test: Default</title>
-       <link rel="stylesheet" href="../visual.css" type="text/css" />
-       <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
-       <script type="text/javascript" src="../../../jquery-1.7.2.js"></script>
-       <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script>
-       <script type="text/javascript">
+       <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css">
+       <script src="../../../jquery-1.7.2.js"></script>
+       <script src="../../../ui/jquery.ui.core.js"></script>
+       <script src="../../../ui/jquery.ui.widget.js"></script>
+       <script src="../../../ui/jquery.ui.position.js"></script>
+       <script src="../../../ui/jquery.ui.menu.js"></script>
+       <script>
        $(function() {
-               $.fn.themeswitcher && $('<div/>').css({
-                       position: "absolute",
-                       right: 10,
-                       top: 10
-               }).appendTo(document.body).themeswitcher();
+               function logger( event, ui ) {
+                       $( "<p>" ).text( "Selected: " + ui.item.text() ).appendTo( "#log" );
+               }
 
-               $("#menu1, #menu2, #menu3, .menu4").menu({
-                       select: function(event, ui) {
-                               $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
-                       }
+               $( "#menu1, #menu2, #menu3, .menu4" ).menu({
+                       select: logger
                });
 
-               $("#menu5").menu({
-                       select: function(event, ui) {
-                               $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
-                       },
-                       menus: "div"
+               $( "#menu5" ).menu({
+                       menus: "div",
+                       select: logger
                });
 
-               $("#menu6").menu({
-                       select: function(event, ui) {
-                               $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
-                       },
-                       menus: ".menuElement"
+               $( "#menu6" ).menu({
+                       menus: ".menuElement",
+                       select: logger
                });
        });
        </script>
        </div>
 </div>
 
-<div class="ui-widget" style="clear: left; margin-top:2em; font-family:Arial">
+<div style="position: absolute; top: 1em; right: 1em;">
        Log:
-       <div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
+       <div id="log" style="height: 400px; width: 300px; overflow: auto; border: 1px solid #000;"></div>
 </div>
 
 </body>