aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.popup.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2011-09-21 22:54:29 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2011-09-21 22:54:29 +0200
commitcb372b7c2022f0827a5aeab117f0a21ff7cb8193 (patch)
tree8f25417744de7ebbfddaa9dd34b15af104510a90 /ui/jquery.ui.popup.js
parenta3866bf057a8ef1d72f07de6fc12c2d9e4e4bb6f (diff)
downloadjquery-ui-cb372b7c2022f0827a5aeab117f0a21ff7cb8193.tar.gz
jquery-ui-cb372b7c2022f0827a5aeab117f0a21ff7cb8193.zip
Popup: Make menu dependency actually optional, cleanup demos
Diffstat (limited to 'ui/jquery.ui.popup.js')
-rw-r--r--ui/jquery.ui.popup.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/jquery.ui.popup.js b/ui/jquery.ui.popup.js
index 4ef1e2c29..ce7a565db 100644
--- a/ui/jquery.ui.popup.js
+++ b/ui/jquery.ui.popup.js
@@ -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 {