diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-06-09 17:14:21 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-06-09 17:14:21 +0200 |
commit | 7281f9f22904d97b3d244a1c8ed2450e6506d538 (patch) | |
tree | ef130e6c68146fa41187450a01e44225e8ab35ff /ui | |
parent | 433ed6eecf055eba327ced7e7c0ff0ce9b5fc304 (diff) | |
download | jquery-ui-7281f9f22904d97b3d244a1c8ed2450e6506d538.tar.gz jquery-ui-7281f9f22904d97b3d244a1c8ed2450e6506d538.zip |
Update menubar to forward menu option to nested menus, update default demo to set within update to the demo frame (for /demos) or window (standalone). Update visual test to have more useful defaults
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.menubar.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ui/jquery.ui.menubar.js b/ui/jquery.ui.menubar.js index a0e9afb3c..39e75924e 100644 --- a/ui/jquery.ui.menubar.js +++ b/ui/jquery.ui.menubar.js @@ -21,7 +21,11 @@ $.widget( "ui.menubar", { version: "@VERSION", options: { buttons: false, - menuIcon: false + menuIcon: false, + position: { + my: "left top", + at: "left bottom" + } }, _create: function() { var that = this; @@ -39,6 +43,9 @@ $.widget( "ui.menubar", { this._hoverable( items ); items.next( "ul" ) .menu({ + position: { + within: this.options.position.within + }, select: function( event, ui ) { ui.item.parents( "ul.ui-menu:last" ).hide(); that._trigger( "select", event, ui ); @@ -119,7 +126,7 @@ $.widget( "ui.menubar", { // TODO ui-menubar-link is added above, not needed here? input.addClass( "ui-menubar-link" ).removeClass( "ui-state-default" ); }; - + }); that._bind( { keydown: function( event ) { @@ -210,11 +217,9 @@ $.widget( "ui.menubar", { var button = menu.prev().addClass( "ui-state-active" ).attr( "tabIndex", -1 ); this.active = menu .show() - .position( { - my: "left top", - at: "left bottom", + .position( $.extend({ of: button - }) + }, this.options.position ) ) .removeAttr( "aria-hidden" ) .attr( "aria-expanded", "true" ) .menu("focus", event, menu.children( "li" ).first() ) |