diff options
Diffstat (limited to 'addons/website/static/src/js/content/menu.js')
| -rw-r--r-- | addons/website/static/src/js/content/menu.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/addons/website/static/src/js/content/menu.js b/addons/website/static/src/js/content/menu.js index c5371e3c5fb..42a12414557 100644 --- a/addons/website/static/src/js/content/menu.js +++ b/addons/website/static/src/js/content/menu.js @@ -98,6 +98,17 @@ sAnimation.registry.autohideMenu = sAnimation.Class.extend({ def.resolve(); }); }); + + // The previous code will make sure we wait for images to be fully + // loaded before initializing the auto more menu. But in some cases, + // it is not enough, we also have to wait for fonts or even extra + // scripts. Those will have no impact on the feature in most cases + // though, so we will only update the auto more menu at that time, + // no wait for it to initialize the feature. + var $window = $(window); + $window.on('load.autohideMenu', function () { + $window.trigger('resize'); + }); } return $.when.apply($, defs).then(function () { if (!self.noAutohide) { @@ -112,6 +123,7 @@ sAnimation.registry.autohideMenu = sAnimation.Class.extend({ destroy: function () { this._super.apply(this, arguments); if (!this.noAutohide) { + $(window).off('.autohideMenu'); dom.destroyAutoMoreMenu(this.$el); } }, |
