]> source.dussan.org Git - jquery-ui.git/commitdiff
Button demo: Coding standards.
authorScott González <scott.gonzalez@gmail.com>
Tue, 11 Jan 2011 02:58:17 +0000 (21:58 -0500)
committerScott González <scott.gonzalez@gmail.com>
Tue, 11 Jan 2011 02:58:17 +0000 (21:58 -0500)
demos/button/splitbutton.html

index 8baf12f002b262207e623fdcb7f2508682ac5e56..966ec8b97e018b2ad337b065741069e92e1b67de 100644 (file)
@@ -11,6 +11,9 @@
        <script src="../../ui/jquery.ui.position.js"></script>
        <script src="../../ui/jquery.ui.menu.js"></script>
        <link rel="stylesheet" href="../demos.css">
+       <style>
+               .ui-menu { position: absolute; width: 100px; }
+       </style>
        <script>
        $(function() {
                $( "#rerun" )
                        .click(function() {
                                alert( "Running the last action" );
                        })
-               .next()
-                       .button( {
-                               text: false,
-                               icons: {
-                                       primary: "ui-icon-triangle-1-s"
-                               }
-                       })
-                       .click( function() {
-                               var menu = $(this).parent().next().show().position({
-                                       my: "left top",
-                                       at: "left bottom",
-                                       of: this
-                               });
-                               $(document).one("click", function() {
-                                       menu.hide();
-                               });
-                               return false;
-                       })
-               .parent()
-                       .buttonset()
-               .next()
-                       .hide()
-                       .menu();
+                       .next()
+                               .button({
+                                       text: false,
+                                       icons: {
+                                               primary: "ui-icon-triangle-1-s"
+                                       }
+                               })
+                               .click(function() {
+                                       var menu = $( this ).parent().next().show().position({
+                                               my: "left top",
+                                               at: "left bottom",
+                                               of: this
+                                       });
+                                       $( document ).one( "click", function() {
+                                               menu.hide();
+                                       });
+                                       return false;
+                               })
+                               .parent()
+                                       .buttonset()
+                                       .next()
+                                               .hide()
+                                               .menu();
        });
        </script>
-       <style>
-               .ui-menu { position: absolute; width: 100px; }
-       </style>
 </head>
 <body>