diff options
Diffstat (limited to 'addons/web_editor')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.options.js | 16 |
1 files changed, 10 insertions, 6 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 8d5e385408d..b218ea9c5d4 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -1241,12 +1241,16 @@ const ColorpickerUserValueWidget = SelectUserValueWidget.extend({ const _super = this._super.bind(this); const args = arguments; - // TODO review in master, this was done in stable to keep the speed fix - // as stable as possible (to have a reference to a widget even if not a - // colorPalette widget). - this.colorPalette = new Widget(this); - this.colorPalette.getColorNames = () => []; - await this.colorPalette.appendTo(document.createDocumentFragment()); + if (this.options.dataAttributes.lazyPalette === 'true') { + // TODO review in master, this was done in stable to keep the speed + // fix as stable as possible (to have a reference to a widget even + // if not a colorPalette widget). + this.colorPalette = new Widget(this); + this.colorPalette.getColorNames = () => []; + await this.colorPalette.appendTo(document.createDocumentFragment()); + } else { + await this._renderColorPalette(); + } // Build the select element with a custom span to hold the color preview this.colorPreviewEl = document.createElement('span'); |
