Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:jquery/jquery-ui

  • Loading branch information...
scottgonzalez committed Feb 25, 2011
2 parents 0cd2977 + 643e20c commit f095f23ffa43a0376610cc7bc065e036dd39027a
Showing with 14 additions and 6 deletions.
  1. +1 −1 tests/visual/menu/menubar.html
  2. +13 −5 tests/visual/menu/menubar.js
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<title>Menu Visual Test: Default</title>
@@ -13,7 +13,7 @@ $.widget("ui.menubar", {
},
_create: function() {
var self = this;
var items = this.element.children("button, a");
var items = this.items = this.element.children("button, a");
var o = this.options;

this.element.addClass('ui-menubar ui-widget-header ui-helper-clearfix');
@@ -69,17 +69,25 @@ $.widget("ui.menubar", {

});
$(document).click(function(event) {
!$(event.target).closest(".ui-menubar").length && items.next("ul").hide();
!$(event.target).closest(".ui-menubar").length && self._close();
});
},

_close: function() {
this.items.next("ul").hide();
this.items.removeClass("ui-state-active");
},

_open: function(event, menu) {
this.active && this.active.menu("closeAll").hide();
if (this.active) {
this.active.menu("closeAll").hide();
this.active.prev().removeClass("ui-state-active");
}
var button = menu.prev().addClass("ui-state-active");
this.active = menu.show().position({
my: "left top",
at: "left bottom",
offset: "0 -1",
of: menu.prev()
of: button
}).focus();
},

0 comments on commit f095f23

Please sign in to comment.
You can’t perform that action at this time.