From b8460e2ef948405283006b16c93bc1226383c9a6 Mon Sep 17 00:00:00 2001 From: Rolux Date: Tue, 9 Feb 2010 17:50:23 +0530 Subject: [PATCH] fix for main menu --- build/js/ox.ui.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 4f77023..a1ec7cf 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -1906,9 +1906,11 @@ requires function onHideMenu() { Ox.print("hideMenu self.selected", self.selected) - that.titles[self.selected].removeClass("OxSelected"); + if (self.selected > -1) { + that.titles[self.selected].removeClass("OxSelected"); + self.selected = -1; + } self.focused = false; - self.selected = -1; } self.onChange = function(key, value) { @@ -2035,9 +2037,12 @@ requires item = that.items[position]; if (!item.options("disabled")) { clickItem(position); + } else { + that.hideMenu(); } + } else { + that.hideMenu(); } - that.hideMenu(); } function clickItem(position) { @@ -2047,21 +2052,26 @@ requires if (that.options("parent")) { that.options("parent").hideMenu().triggerEvent("click"); } + Ox.Event.trigger("click_" + self.options.id, { + id: item.options("id"), + value: item.options("title")[0] // fixme: value or title? + }); if (item.options("checked") !== null && (!item.options("group") || !item.options("checked"))) { item.options({ checked: !item.options("checked") }); - Ox.Event.trigger("click_" + self.options.id, { + Ox.Event.trigger("change_" + item.options("group"), { id: item.options("id"), value: item.options("title")[0] // fixme: value or title? - }) - Ox.Event.trigger("click_" + item.options("id"), { }); + } else { + Ox.Event.trigger("click_" + item.options("id")); } if (item.options("title").length == 2) { item.toggleTitle(); } } + that.hideMenu(); } function clickSelectedItem() {