[FIX] website: load wysiwyg in iframe only for publishers
See merge commit for more information. task-2687506
This commit is contained in:
@@ -23,7 +23,8 @@
|
||||
class="o_iframe"
|
||||
t-ref="iframe"
|
||||
t-on-load="_onPageLoaded"
|
||||
is-ready="false"/>
|
||||
is-ready="false"
|
||||
t-att-data-load-wysiwyg="this.websiteService.isPublisher ? 'true': 'false'"/>
|
||||
</div>
|
||||
<WebsiteEditorComponent t-if="websiteContext.edition"
|
||||
reloadIframe.bind="this.reloadIframe"
|
||||
|
||||
@@ -5,7 +5,9 @@ import { WebsiteRoot } from "./website_root";
|
||||
import { loadWysiwyg } from "web_editor.loader";
|
||||
|
||||
export default createPublicRoot(WebsiteRoot).then(rootInstance => {
|
||||
if (window.parent !== window) {
|
||||
// This data attribute is set by the WebsitePreview client action for a
|
||||
// publisher user.
|
||||
if (window.frameElement && window.frameElement.dataset.loadWysiwyg) {
|
||||
loadWysiwyg(['website.compiled_assets_wysiwyg']).then(() => {
|
||||
window.dispatchEvent(new CustomEvent('PUBLIC-ROOT-READY', {detail: {rootInstance}}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user