Skip to content
Snippets Groups Projects
Commit 89bdfcd1 authored by Tom De Caluwé's avatar Tom De Caluwé
Browse files

[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#77428

Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
parent 26d37812
Branches
Tags
No related merge requests found
......@@ -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;
},
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment