summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2019-12-13 12:20:40 +0000
committerqsm-odoo <qsm@odoo.com>2019-12-13 17:18:13 +0000
commit2feb17cc0ac3e99d47e639e9249ae35161b53b6a (patch)
tree74449b2b875f92f5281deb656d19670b3fe6cb37 /addons/web_editor/static/src
parentfab7cd3a792fc2e21f63ca274905b3addad65aac (diff)
[FIX] web_editor, website: missing wait of async parts in left panel
- updateUI is async, most of the time it is really important to wait for its async parts. - method options are now async and should wait for async parts and user choices before resolving their returned deferred.
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.options.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js
index 48089a955b6..b8048cd8641 100644
--- a/addons/web_editor/static/src/js/editor/snippets.options.js
+++ b/addons/web_editor/static/src/js/editor/snippets.options.js
@@ -1957,8 +1957,8 @@ registry.sizing = SnippetOptionWidget.extend({
/**
* @override
*/
- updateUI: function () {
- this._super(...arguments);
+ updateUI: async function () {
+ await this._super(...arguments);
const resizeValues = this._getSize();
_.each(resizeValues, (value, key) => {
this.$handles.filter('.' + key).toggleClass('readonly', !value);
@@ -2097,11 +2097,11 @@ registry.background = SnippetOptionWidget.extend({
*
* @see this.selectClass for parameters
*/
- background: function (previewMode, widgetValue, params) {
+ background: async function (previewMode, widgetValue, params) {
if (previewMode === 'reset') {
// No background has been selected and we want to reset back to the
// original custom image
- this._setCustomBackground(this.__customImageSrc); // FIXME this is async...
+ await this._setCustomBackground(this.__customImageSrc);
return;
}