fix for main menu

This commit is contained in:
Rolux 2010-02-09 17:50:23 +05:30
parent 42332e8936
commit b8460e2ef9

View File

@ -1906,10 +1906,12 @@ requires
function onHideMenu() {
Ox.print("hideMenu self.selected", self.selected)
if (self.selected > -1) {
that.titles[self.selected].removeClass("OxSelected");
self.focused = false;
self.selected = -1;
}
self.focused = false;
}
self.onChange = function(key, value) {
@ -2035,10 +2037,13 @@ requires
item = that.items[position];
if (!item.options("disabled")) {
clickItem(position);
}
}
} else {
that.hideMenu();
}
} else {
that.hideMenu();
}
}
function clickItem(position) {
var item = that.items[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() {