[IMP] website: prevent clicking while starting the editor

When visiting a page with enable_editor set to true, the web editor
will be automatically started. However, while the editor is loading,
the end user can still click other buttons in the navbar.

For example, some changes in the web editor require a save and reload
of the current page being edited. After saving, the same page will be
reloaded with enable_editor.

This commit blocks any clicks while the editor is being loaded.

task-2607755

closes odoo/odoo#78721

X-original-commit: 89bdfcd16828e1432900ea46118fd6ddadf96f2d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Tom De Caluwé
2021-10-21 09:56:47 +00:00
parent 6f56216533
commit f81f2a124c
+10 -1
View File
@@ -69,7 +69,7 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
*
* @override
*/
start: function () {
start() {
var def = this._super.apply(this, arguments);
// If we auto start the editor, do not show a welcome message
@@ -205,6 +205,13 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
if (this.editModeEnable) {
return;
}
$.blockUI({overlayCSS: {
backgroundColor: '#000',
opacity: 0,
zIndex: 1050
}, message: false});
this.trigger_up('widgets_stop_request', {
$target: this._targetForEdition(),
});
@@ -228,6 +235,8 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({
$loader.remove();
}
$.unblockUI();
return res;
},
/**