From 237d12ece7606d4eeb90b263705261ef199bbe66 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sun, 18 Mar 2012 14:31:54 +0000 Subject: [PATCH] allow for checking a menu item that is part of a group --- source/Ox.UI/js/Menu/Ox.MainMenu.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/Ox.UI/js/Menu/Ox.MainMenu.js b/source/Ox.UI/js/Menu/Ox.MainMenu.js index dd99a13f..6fce7bb7 100644 --- a/source/Ox.UI/js/Menu/Ox.MainMenu.js +++ b/source/Ox.UI/js/Menu/Ox.MainMenu.js @@ -140,8 +140,15 @@ Ox.MainMenu = function(options, self) { checkItem 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; };