aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormaggiewachs <maggie@filamentgroup.com>2011-02-24 16:00:32 -0500
committermaggiewachs <maggie@filamentgroup.com>2011-02-24 16:00:32 -0500
commit63a72814bedd420a2a0bc2bc3fee3ba8d132fa64 (patch)
tree3dfe1eb7befc8dc534c29ae2d82e5dc890db3172 /tests
parent75afd3319b98cd19b21027ddc26c700f38841c79 (diff)
downloadjquery-ui-63a72814bedd420a2a0bc2bc3fee3ba8d132fa64.tar.gz
jquery-ui-63a72814bedd420a2a0bc2bc3fee3ba8d132fa64.zip
Added two options to set the button style and add down arrow icons
Diffstat (limited to 'tests')
-rw-r--r--tests/visual/menu/menubar.js39
1 files changed, 26 insertions, 13 deletions
diff --git a/tests/visual/menu/menubar.js b/tests/visual/menu/menubar.js
index 9bb3f38e9..f384668d4 100644
--- a/tests/visual/menu/menubar.js
+++ b/tests/visual/menu/menubar.js
@@ -7,10 +7,15 @@
// TODO take non-menubar buttons into account
$.widget("ui.menubar", {
+ options: {
+ buttons: false,
+ menuIcon: false
+ },
_create: function() {
var self = this;
var items = this.element.children("button, a");
-
+ var o = this.options;
+
this.element.addClass('ui-menubar ui-widget-header ui-helper-clearfix');
items.next("ul").each(function(i, elm) {
@@ -42,18 +47,26 @@ $.widget("ui.menubar", {
});
items.each(function() {
var input = $(this),
- menu = input.next("ul");
- input.bind("click focus mouseenter", function(event) {
- if (menu.length && (!/^mouse/.test(event.type) || self.active && self.active.is(":visible") )) {
- self._open(event, menu);
- }
- event.preventDefault();
- event.stopPropagation();
- }).button({
- icons: {
- secondary: menu.length ? 'ui-icon-triangle-1-s' : ''
- }
- });
+ menu = input.next("ul");
+
+ input
+ .bind("click focus mouseenter", function(event) {
+ if (menu.length && (!/^mouse/.test(event.type) || self.active && self.active.is(":visible") )) {
+ self._open(event, menu);
+ }
+ event.preventDefault();
+ event.stopPropagation();
+ })
+ .button({
+ icons: {
+ secondary: o.menuIcon ? (menu.length ? 'ui-icon-triangle-1-s' : '') : ''
+ }
+ });
+
+ if (!o.buttons) {
+ input.addClass('ui-menubar-link').removeClass('ui-state-default');
+ };
+
});
$(document).click(function(event) {
!$(event.target).closest(".ui-menubar").length && items.next("ul").hide();