From 54c2103014831c84ccd276eeef4ac550becd3f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=C3=ADaz?= Date: Thu, 8 Aug 2019 16:43:40 +0200 Subject: [PATCH 1/3] [IMP] web_responsive: Don't show menu if waiting for an action to end --- web_responsive/static/src/js/web_responsive.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web_responsive/static/src/js/web_responsive.js b/web_responsive/static/src/js/web_responsive.js index 1851de9df..b356c0b8c 100644 --- a/web_responsive/static/src/js/web_responsive.js +++ b/web_responsive/static/src/js/web_responsive.js @@ -351,6 +351,17 @@ odoo.define('web_responsive', function (require) { return this._super.apply(this, arguments); } }, + + /** + * Don't display the menu if are waiting for an action to end + * + * @override + */ + _onMouseOverMenu: function () { + if ($('.oe_wait').length === 0) { + this._super.apply(this, arguments); + } + }, }); RelationalFields.FieldStatus.include({ From 0c06496dcf8e1617b7d3866807fb3a164013fde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=C3=ADaz?= Date: Thu, 8 Aug 2019 16:49:53 +0200 Subject: [PATCH 2/3] [IMP] web_responsive: Small refactor 'isWaiting' --- .../static/src/js/web_responsive.js | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/web_responsive/static/src/js/web_responsive.js b/web_responsive/static/src/js/web_responsive.js index b356c0b8c..2b8656da0 100644 --- a/web_responsive/static/src/js/web_responsive.js +++ b/web_responsive/static/src/js/web_responsive.js @@ -15,6 +15,14 @@ odoo.define('web_responsive', function (require) { var RelationalFields = require('web.relational_fields'); var Chatter = require('mail.Chatter'); + /* + * Helper function to know if are waiting + * + */ + function isWaiting () { + return $('.oe_wait').length !== 0; + } + /** * Reduce menu data to a searchable format understandable by fuzzy.js * @@ -115,7 +123,7 @@ odoo.define('web_responsive', function (require) { /** * Prevent the menu from being opened twice - * + * * @override */ _onAppsMenuItemClicked: function (ev) { @@ -283,15 +291,15 @@ odoo.define('web_responsive', function (require) { * Control if AppDrawer can be closed */ _hideAppsMenu: function () { - return $('.oe_wait').length === 0 && !this.$('input').is(':focus'); + return !isWaiting() && !this.$('input').is(':focus'); }, }); BasicController.include({ - + /** * Close the AppDrawer if the data set is dirty and a discard dialog is opened - * + * * @override */ canBeDiscarded: function (recordID) { @@ -326,7 +334,7 @@ odoo.define('web_responsive', function (require) { if ( this.$menu_toggle.is(":visible") && this.$section_placeholder.is(":visible") && - $('.oe_wait').length === 0 + !isWaiting() ) { this.$section_placeholder.collapse("hide"); } @@ -338,7 +346,7 @@ odoo.define('web_responsive', function (require) { * @returns {Boolean} */ _hideMenuSection: function () { - return $('.oe_wait').length === 0; + return !isWaiting(); }, /** @@ -358,7 +366,7 @@ odoo.define('web_responsive', function (require) { * @override */ _onMouseOverMenu: function () { - if ($('.oe_wait').length === 0) { + if (!isWaiting()) { this._super.apply(this, arguments); } }, From d6b474790d245d761ef0f2087756f21148659503 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 9 Aug 2019 11:26:00 +0000 Subject: [PATCH 3/3] web_responsive 12.0.1.1.3 --- web_responsive/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_responsive/__manifest__.py b/web_responsive/__manifest__.py index 737226596..8e845fdcf 100644 --- a/web_responsive/__manifest__.py +++ b/web_responsive/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Web Responsive", "summary": "Responsive web client, community-supported", - "version": "12.0.1.1.2", + "version": "12.0.1.1.3", "category": "Website", "website": "https://github.com/OCA/web", "author": "LasLabs, Tecnativa, Alexandre Díaz, "