clone menu items before extending them

This commit is contained in:
rolux 2012-06-17 19:11:23 +02:00
parent 9dbedf13f9
commit 36a5f5a95f

View file

@ -16,7 +16,6 @@ Ox.Menu <f> Menu Object
side <s> open to 'bottom' or 'right'
size <s> 'large', 'medium' or 'small'
self <o> shared private variable
change_groupId <!> {id, value} checked item of a group has changed
click_itemId <!> item not belonging to a group was clicked
click_menuId <!> {id, value} item not belonging to a group was clicked
@ -316,7 +315,7 @@ Ox.Menu = function(options, self) {
var position;
if ('id' in item) {
that.items.push(
Ox.MenuItem(Ox.extend(item, {
Ox.MenuItem(Ox.extend(Ox.clone(item), {
maxWidth: self.options.maxWidth,
menu: that,
position: position = that.items.length