allow for checking a menu item that is part of a group

This commit is contained in:
rlx 2012-03-18 14:31:54 +00:00
parent b7e626ace5
commit 237d12ece7

View file

@ -140,8 +140,15 @@ Ox.MainMenu = function(options, self) {
checkItem <f> checkItem
@*/
that.checkItem = function(id) {
var item = that.getItem(id);
item && item.options({checked: true});
var ids = id.split('_'),
item = that.getItem(id);
if (item) {
if (item.options('group')) {
item.options('menu').checkItem(ids[ids.length - 1]);
} else {
item.options({checked: true});
}
}
return that;
};