diff options
| author | Aaron Bohy <aab@odoo.com> | 2016-04-08 14:53:34 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2016-04-21 15:21:39 +0200 |
| commit | 977db823c7c84e9edc7c8cf8384eb9cf47275b3a (patch) | |
| tree | c3312f745baf11d51f976a60d6e285480f557d4c /addons/web/static/src/js/menu.js | |
| parent | e1bfd3fbda97ac7a64a585b07be161d5be606cf9 (diff) | |
[REF] web: stop duplicating web
Avoid duplicating web addon in enterprise by extracting a common basis.
Enterprise features stay in enterprise, but use that common basis.
Mainly:
- JS refactoring and linting
- Conversion of .sass into .less split into multiple files
- Templates cleaning and DOM simplification
- Re-generation of web.pot, and update of .po files
Diffstat (limited to 'addons/web/static/src/js/menu.js')
| -rw-r--r-- | addons/web/static/src/js/menu.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/web/static/src/js/menu.js b/addons/web/static/src/js/menu.js index 4d8671595bd..c244305b7aa 100644 --- a/addons/web/static/src/js/menu.js +++ b/addons/web/static/src/js/menu.js @@ -15,7 +15,7 @@ var Menu = Widget.extend({ this.data = {data:{children:[]}}; this.on("menu_bound", this, function() { // launch the fetch of needaction counters, asynchronous - var $all_menus = self.$el.parents('body').find('.oe_webclient').find('[data-menu]'); + var $all_menus = self.$el.parents('.o_web_client').find('.o_sub_menu').find('[data-menu]'); var all_menu_ids = _.map($all_menus, function (menu) {return parseInt($(menu).attr('data-menu'), 10);}); if (!_.isEmpty(all_menu_ids)) { this.do_load_needaction(all_menu_ids); @@ -34,7 +34,7 @@ var Menu = Widget.extend({ }, bind_menu: function() { var self = this; - this.$secondary_menus = this.$el.parents().find('.oe_secondary_menus_container'); + this.$secondary_menus = this.$el.parents().find('.o_sub_menu'); this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click); this.$el.on('click', 'a[data-menu]', function (event) { event.preventDefault(); @@ -160,7 +160,7 @@ var Menu = Widget.extend({ $sub_menu.show(); // Hide/Show the leftbar menu depending of the presence of sub-items - this.$secondary_menus.parent('.oe_leftbar').toggle(!!$sub_menu.children().length); + this.$secondary_menus.toggle(!!$sub_menu.children().length); // Activate current menu item and show parents this.$secondary_menus.find('.active').removeClass('active'); |
