首页 > 解决方案 > Tinymce-angular:编辑器全屏问题

问题描述

我在用着<editor *ngIf="defaultContent" [(ngModel)]='defaultContent' [init]='editorConfig'>

https://github.com/tinymce/tinymce-angular

这是我下面的配置-

export const editorConfig = {
    skin_url: '/assets/skins/lightgray',
    theme: 'modern',
    content_css: targetElt.getAttribute('href'),
    height: 300,
    branding: false,
    // content_security_policy: 'script-src \'self\' \'unsafe-inline\'; connect-src \'self\'; img-src \'self\';' +
    //     'style-src \'self\' \'unsafe-inline\';',
    plugins: 'textcolor anchor link lists wordcount fullscreen hr code table', // template
    hidden_input: false,
    menubar: false,
    toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify  |' +
    'numlist bullist outdent indent  | paste | section | row | info | fullscreen | template | removeformat |' +
    'undo redo | code | table',
    templates: [
        {
            title: 'Some title 1', description: 'Some desc 1', content: '<div class="col-sm-12"><div class="row widget-sd">' +
            '<div class="sd-img col-sm-3"><img src="https://image.flaticon.com/icons/svg/321/321718.svg"></div>' +
            '<div class="col-sm-9"></div></div></div>'
        }
    ],
    table_default_attributes: {
        'border': '0'
    },
    table_default_styles: {
        'border-collapsed': 'collapse',
        'width': '100%'
    },
    table_responsive_width: true,
    table_advtab: false
}

当我单击编辑器全屏然后单击浏览器后屏幕并再次访问编辑器屏幕然后屏幕冻结时,我的主题上没有出现滚动条。

标签: cssangulartinymcescrollbartinymce-4

解决方案


我已经删除了 ngOnDestroy 上的 .mce-fullscreen 类。

document.body.className = document.body.className.replace('mce-fullscreen', ''); $('html').removeClass('mce-fullscreen');


推荐阅读