fix Menu.checkItem with checked argument for groups and submenues

This commit is contained in:
j 2015-04-16 20:02:36 +01:00
parent c83e7b6930
commit cacdba606e

View file

@ -660,17 +660,19 @@ Ox.Menu = function(options, self) {
if (group) {
offset = self.optionGroupOffset[group];
position = getItemPositionById(id);
toggled = self.optionGroup[item.options('group')].toggle(position - offset);
if (toggled.length) {
toggled.forEach(function(pos) {
that.items[pos + offset].toggleChecked();
});
if (item.options('checked') != checked) {
toggled = self.optionGroup[item.options('group')].toggle(position - offset);
if (toggled.length) {
toggled.forEach(function(pos) {
that.items[pos + offset].toggleChecked();
});
}
}
} else {
item.options({checked: checked});
}
} else {
that.submenus[ids.shift()].checkItem(ids.join('_'));
that.submenus[ids.shift()].checkItem(ids.join('_'), checked);
}
return that;
};