From 8fb9319192e66f94b42c365813a9a187b6a19425 Mon Sep 17 00:00:00 2001 From: Rolux Date: Fri, 2 Jul 2010 15:06:13 +0200 Subject: [PATCH] only show/hide menu when not shown/hidden (so that events are not bound/unbound twice) --- build/css/ox.ui.modern.css | 6 ++++-- build/js/ox.ui.js | 7 +++++++ demos/test/list.js | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build/css/ox.ui.modern.css b/build/css/ox.ui.modern.css index 6932d248..9f03cf45 100644 --- a/build/css/ox.ui.modern.css +++ b/build/css/ox.ui.modern.css @@ -5,8 +5,10 @@ body.OxThemeModern { color: rgb(240, 240, 240); } .OxThemeModern .OxHighlight { - background: rgb(255, 255, 0); - color: rgb(0, 0, 0); + //background: rgb(255, 255, 0); + //font-weight: bold; + //color: rgb(0, 0, 0); + color: rgb(255, 255, 0); } /* diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index e500ff7b..ef2e4520 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -1999,6 +1999,7 @@ requires } function onClick(event, data) { + Ox.print("onClick", data); that.$input.focus().val(Ox.stripTags(data.title)); self.autocompleteMenu.hideMenu(); submit(); @@ -3821,6 +3822,9 @@ requires }; that.hideMenu = function() { + if (that.is(":hidden")) { + return; + } $.each(that.submenus, function(i, submenu) { if (submenu.is(":visible")) { submenu.hideMenu(); @@ -3861,6 +3865,9 @@ requires }; that.showMenu = function() { + if (!that.is(":hidden")) { + return; + } if (!self.options.parent && !that.$layer.parent().length) { that.$layer.appendTo($body); } diff --git a/demos/test/list.js b/demos/test/list.js index b8b12466..aac844c3 100644 --- a/demos/test/list.js +++ b/demos/test/list.js @@ -290,7 +290,7 @@ $(function() { } }, clear: true, - highlight: false, + highlight: true, id: "find", label: [ { id: "all", title: "Find: All" }, @@ -369,8 +369,8 @@ $(function() { ], menus: [ { - id: "demo", - title: "Demo", + id: "oxdb", + title: "OxDB", items: [ { id: "about", title: "About" } ]