diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index f17200bb03f..2187c607e7c 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -202,7 +202,7 @@ const Wysiwyg = Widget.extend({ commands: powerboxOptions.commands, categories: powerboxOptions.categories, plugins: options.editorPlugins, - direction: localization.direction || 'ltr', + direction: options.direction || localization.direction || 'ltr', collaborationClientAvatarUrl: `${browser.location.origin}/web/image?model=res.users&field=avatar_128&id=${this.getSession().uid}`, }, editorCollaborationOptions)); diff --git a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js index e5cd7397bf7..ca075adcc68 100644 --- a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js +++ b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js @@ -279,6 +279,7 @@ export class WysiwygAdapterComponent extends ComponentAdapter { showEmptyElementHint: false, getReadOnlyAreas: this._getReadOnlyAreas.bind(this), getUnremovableElements: this._getUnremovableElements.bind(this), + direction: this.websiteService.currentWebsite.metadata.direction, ...this.props.wysiwygOptions, }; } diff --git a/addons/website/static/src/services/website_service.js b/addons/website/static/src/services/website_service.js index 5c78065b03c..764cfa43dfc 100644 --- a/addons/website/static/src/services/website_service.js +++ b/addons/website/static/src/services/website_service.js @@ -126,6 +126,7 @@ export const websiteService = { editable: !!document.getElementById('wrapwrap'), viewXmlid: viewXmlid, lang: document.documentElement.getAttribute('lang').replace('-', '_'), + direction: document.documentElement.querySelector('#wrapwrap.o_rtl') ? 'rtl' : 'ltr', }; } contentWindow = document.defaultView;