From e126cd3bb2b20bc993d2472eee5fe16cc7a74ea9 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 16 Sep 2020 11:51:38 +0000 Subject: [IMP] web_editor, website: improve editor loading effects - Share the code for tab switching loading and slow option loading. - Now add a loading effect over the content when the content is changed and a loading effect over the editor panel when the editor panel is being changed Part of https://github.com/odoo/odoo/pull/55614 task-2213114 closes odoo/odoo#55614 Signed-off-by: Quentin Smetz (qsm) --- addons/website/static/src/js/editor/snippets.editor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'addons/website/static/src/js/editor/snippets.editor.js') diff --git a/addons/website/static/src/js/editor/snippets.editor.js b/addons/website/static/src/js/editor/snippets.editor.js index 98c2b13ed34..e226fd70543 100644 --- a/addons/website/static/src/js/editor/snippets.editor.js +++ b/addons/website/static/src/js/editor/snippets.editor.js @@ -151,9 +151,9 @@ weSnippetEditor.Class.include({ /** * @private */ - _onThemeTabClick: async function (ev) { - this._addTabLoading(this.tabs.THEME); - await new Promise(resolve => setTimeout(() => resolve())); // Needed to force the loading to appear... to review with new design + async _onThemeTabClick(ev) { + // Note: nothing async here but start the loading effect asap + this._execWithLoadingEffect(async () => new Promise(resolve => setTimeout(() => resolve(), 0)), false, 0); if (!this.topFakeOptionEl) { let el; -- cgit v1.2.3