From 498c5effa23b7c808478c2425dcb813b4c3162a4 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Mon, 22 Sep 2014 16:03:25 +0200 Subject: [PATCH] Ox.Menu: fix super binding, cosmetic changes --- source/Ox.UI/js/Menu/Menu.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/source/Ox.UI/js/Menu/Menu.js b/source/Ox.UI/js/Menu/Menu.js index a530fb43..a6b6b5f8 100644 --- a/source/Ox.UI/js/Menu/Menu.js +++ b/source/Ox.UI/js/Menu/Menu.js @@ -327,15 +327,17 @@ Ox.Menu = function(options, self) { items.forEach(function(item) { var position; if ('id' in item) { + position = that.items.length; that.items.push( Ox.MenuItem(Ox.extend(Ox.clone(item), { maxWidth: self.options.maxWidth, menu: that, - position: position = that.items.length + position: position })) .data('position', position) + // fixme: jquery bug when passing {position: position}? does not return the object? .appendTo(that.$content) - ); // fixme: jquery bug when passing {position: position}? does not return the object?; + ); if (item.items) { that.submenus[item.id] = Ox.Menu({ edge: 'right', @@ -343,10 +345,7 @@ Ox.Menu = function(options, self) { id: Ox.toCamelCase(self.options.id + '/' + item.id), items: item.items, mainmenu: self.options.mainmenu, - offset: { - left: 0, - top: -4 - }, + offset: {left: 0, top: -4}, parent: that, size: self.options.size }); @@ -367,10 +366,7 @@ Ox.Menu = function(options, self) { function renderLine() { return $('