fix Menu.checkItem with checked argument for groups and submenues
This commit is contained in:
parent
c83e7b6930
commit
cacdba606e
1 changed files with 8 additions and 6 deletions
|
@ -660,17 +660,19 @@ Ox.Menu = function(options, self) {
|
||||||
if (group) {
|
if (group) {
|
||||||
offset = self.optionGroupOffset[group];
|
offset = self.optionGroupOffset[group];
|
||||||
position = getItemPositionById(id);
|
position = getItemPositionById(id);
|
||||||
toggled = self.optionGroup[item.options('group')].toggle(position - offset);
|
if (item.options('checked') != checked) {
|
||||||
if (toggled.length) {
|
toggled = self.optionGroup[item.options('group')].toggle(position - offset);
|
||||||
toggled.forEach(function(pos) {
|
if (toggled.length) {
|
||||||
that.items[pos + offset].toggleChecked();
|
toggled.forEach(function(pos) {
|
||||||
});
|
that.items[pos + offset].toggleChecked();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
item.options({checked: checked});
|
item.options({checked: checked});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
that.submenus[ids.shift()].checkItem(ids.join('_'));
|
that.submenus[ids.shift()].checkItem(ids.join('_'), checked);
|
||||||
}
|
}
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue