diff options
| author | Fabien Meghazi <fme@openerp.com> | 2012-06-19 23:22:12 +0200 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2012-06-19 23:22:12 +0200 |
| commit | da09aec9ca73b6e4e2f9c9563c902d3d6ca06fa8 (patch) | |
| tree | 790352c77abeec3d50e82c4c05d8b606540413ae /addons/web/static/src/js/chrome.js | |
| parent | c005a6a2ba7a2700dbde43e050e1c728704c5737 (diff) | |
[WIP] Update Menu [More...]
bzr revid: fme@openerp.com-20120619212212-k2yl19h2x1oan1o6
Diffstat (limited to 'addons/web/static/src/js/chrome.js')
| -rw-r--r-- | addons/web/static/src/js/chrome.js | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 0e337bad750..62f81156326 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -582,10 +582,6 @@ instance.web.Menu = instance.web.Widget.extend({ this.renderElement(); this.limit_entries(); this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this })); - this.$element.on('click', 'a.oe_menu_more_link', function() { - self.$element.find('.oe_menu_more').toggle(); - return false; - }); this.$element.on('click', 'a[data-menu]', this.on_menu_click); this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click); // Hide second level submenus @@ -606,16 +602,12 @@ instance.web.Menu = instance.web.Widget.extend({ $index.after($more); $more.find('.oe_menu_more').append($index.next().nextAll()); } - this.do_hide_more(); }, auto_limit_entries: function() { // TODO: auto detect overflow and bind window on resize var width = $(window).width(); return Math.floor(width / 125); }, - do_hide_more: function() { - this.$element.find('.oe_menu_more').hide(); - }, /** * Opens a given menu by id, as if a user had browsed to that menu by hand * except does not trigger any event on the way @@ -676,7 +668,6 @@ instance.web.Menu = instance.web.Widget.extend({ */ menu_click: function(id) { if (id) { - this.do_hide_more(); // find back the menuitem in dom to get the action var $item = this.$element.find('a[data-menu=' + id + ']'); if (!$item.length) { @@ -708,9 +699,8 @@ instance.web.Menu = instance.web.Widget.extend({ * @param {Event} ev the jquery event */ on_menu_click: function(ev) { + ev.preventDefault(); this.menu_click($(ev.currentTarget).data('menu')); - ev.stopPropagation(); - return false; }, }); |
