]> source.dussan.org Git - jquery-ui.git/commitdiff
Popup: Make menu dependency actually optional, cleanup demos
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 21 Sep 2011 20:54:29 +0000 (22:54 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 21 Sep 2011 20:54:29 +0000 (22:54 +0200)
demos/popup/animation.html
demos/popup/default.html
ui/jquery.ui.popup.js

index 3d5f505839a9267a6f07088613f79ed65564ac64..d14a12cd7b55a158cd306b149f301655295f5cda 100644 (file)
@@ -9,7 +9,6 @@
        <script src="../../ui/jquery.ui.widget.js"></script>
        <script src="../../ui/jquery.ui.position.js"></script>
        <script src="../../ui/jquery.ui.button.js"></script>
-       <script src="../../ui/jquery.ui.menu.js"></script>
        <script src="../../ui/jquery.effects.core.js"></script>
        <script src="../../ui/jquery.effects.blind.js"></script>
        <script src="../../ui/jquery.effects.scale.js"></script>
        </script>
        <style type="text/css">
                .ui-popup { position: absolute; z-index: 5000; }
-               .ui-menu { width: 200px; }
-
-               /*
-               table {
-                       border-collapse: collapse;
-               }
-               th, td {
-                       padding: 0.5em;
-                       border: 1px solid black;
-               }
-               */
 
                #login-form {
                        width: 16em; border: 1px solid gray; border-radius: 5px;
index 97fc01fb2805c3103edc0de347dc1b53b14a9ae0..26c4d19a038552d6bffd517a80e1529379421fa6 100644 (file)
@@ -9,7 +9,6 @@
        <script src="../../ui/jquery.ui.widget.js"></script>
        <script src="../../ui/jquery.ui.position.js"></script>
        <script src="../../ui/jquery.ui.button.js"></script>
-       <script src="../../ui/jquery.ui.menu.js"></script>
        <script src="../../ui/jquery.ui.popup.js"></script>
        <script>
        $(function() {
        </script>
        <style type="text/css">
                .ui-popup { position: absolute; z-index: 5000; }
-               .ui-menu { width: 200px; }
-
-               /*
-               table {
-                       border-collapse: collapse;
-               }
-               th, td {
-                       padding: 0.5em;
-                       border: 1px solid black;
-               }
-               */
 
                #login-form {
                        width: 16em; border: 1px solid gray; border-radius: 5px;
index 4ef1e2c29f19d73082a2031e2b0c23b456468d55..ce7a565db8cdb11a2ee45cbedea25fa9b53b9143 100644 (file)
@@ -88,8 +88,8 @@ $.widget( "ui.popup", {
                        }
                });
 
-               if ( !this.element.is( ":ui-menu" ) ) {
-                       //default use case, wrap tab order in popup
+               if ( !$.ui.menu || !this.element.is( ":ui-menu" ) ) {
+                       // default use case, wrap tab order in popup
                        this._bind({ keydown : function( event ) {
                                        if ( event.keyCode !== $.ui.keyCode.TAB ) {
                                                return;
@@ -174,7 +174,8 @@ $.widget( "ui.popup", {
                        .attr( "aria-expanded", "true" )
                        .position( position );
 
-               if (this.element.is( ":ui-menu" )) { //popup is a menu
+               // can't use custom selector when menu isn't loaded
+               if ( $.ui.menu && this.element.is( ":ui-menu" ) ) {
                        this.element.menu( "focus", event, this.element.children( "li" ).first() );
                        this.element.focus();
                } else {