diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-08-31 18:11:09 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-08-31 18:57:12 +0200 |
| commit | 4bc79da943c71e762e1f6dedbe3a641042bfef3f (patch) | |
| tree | 33a628e7a4b5d07221e08daf3af46b4f2d83de0f /addons/website/static/src/js/content/menu.js | |
| parent | 7253b55f41484fb10810ea32351fbb185906856a (diff) | |
[FIX] website, *: avoid top menu flickering
* portal, web
Diffstat (limited to 'addons/website/static/src/js/content/menu.js')
| -rw-r--r-- | addons/website/static/src/js/content/menu.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/addons/website/static/src/js/content/menu.js b/addons/website/static/src/js/content/menu.js index 3511f51a70f..e0c8011cf9b 100644 --- a/addons/website/static/src/js/content/menu.js +++ b/addons/website/static/src/js/content/menu.js @@ -1,7 +1,6 @@ odoo.define('website.content.menu', function (require) { 'use strict'; -var config = require('web.config'); var dom = require('web.dom'); var sAnimation = require('website.content.snippets.animation'); @@ -76,18 +75,19 @@ sAnimation.registry.affixMenu = sAnimation.Class.extend({ * * Note: this works well with the affixMenu... by chance (autohideMenu is called * after alphabetically). - * - * @todo We may want to avoid some code duplication by sharing what is done in - * the backend in enterprise... */ sAnimation.registry.autohideMenu = sAnimation.Class.extend({ - selector: 'header:not(.o_no_autohide_menu) #top_menu', + selector: 'header #top_menu', /** * @override */ start: function () { - dom.initAutoMoreMenu(this.$el, {unfoldable: '.divider, .divider ~ li'}); + this.noAutohide = this.$el.closest('.o_no_autohide_menu').length; + if (!this.noAutohide) { + dom.initAutoMoreMenu(this.$el, {unfoldable: '.divider, .divider ~ li'}); + } + this.$el.removeClass('o_menu_loading'); return this._super.apply(this, arguments); }, /** @@ -95,7 +95,9 @@ sAnimation.registry.autohideMenu = sAnimation.Class.extend({ */ destroy: function () { this._super.apply(this, arguments); - dom.destroyAutoMoreMenu(this.$el); + if (!this.noAutohide) { + dom.destroyAutoMoreMenu(this.$el); + } }, }); |
