diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index b716fc2fb37..876ae78e3b6 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -284,7 +284,7 @@ const FontFamilyPickerUserValueWidget = SelectUserValueWidget.extend({ } // Adapt font variable indexes to the removal - const style = window.getComputedStyle(document.documentElement); + const style = window.getComputedStyle(this.$target[0].ownerDocument.documentElement); _.each(FontFamilyPickerUserValueWidget.prototype.fontVariables, variable => { const value = weUtils.getCSSVariableValue(variable, style); if (value.substring(1, value.length - 1) === googleFontName) { @@ -1474,7 +1474,7 @@ options.registry.ThemeColors = options.registry.OptionsTab.extend({ */ async start() { // Checks for support of the old color system - const style = window.getComputedStyle(document.documentElement); + const style = window.getComputedStyle(this.$target[0].ownerDocument.documentElement); const supportOldColorSystem = weUtils.getCSSVariableValue('support-13-0-color-system', style) === 'true'; const hasCustomizedOldColorSystem = weUtils.getCSSVariableValue('has-customized-13-0-color-system', style) === 'true'; this._showOldColorSystemWarning = supportOldColorSystem && hasCustomizedOldColorSystem; diff --git a/addons/website/static/src/snippets/s_chart/options.js b/addons/website/static/src/snippets/s_chart/options.js index 146a8b7e74b..711b94ad1f7 100644 --- a/addons/website/static/src/snippets/s_chart/options.js +++ b/addons/website/static/src/snippets/s_chart/options.js @@ -27,7 +27,7 @@ options.registry.InnerChart = options.Class.extend({ init: function () { this._super.apply(this, arguments); this.themeArray = ['o-color-1', 'o-color-2', 'o-color-3', 'o-color-4', 'o-color-5']; - this.style = window.getComputedStyle(document.documentElement); + this.style = window.getComputedStyle(this.$target[0].ownerDocument.documentElement); }, /** * @override