【问题标题】:Add style to element over the custom button in TinyMCE 5?在 TinyMCE 5 中的自定义按钮上向元素添加样式?
【发布时间】:2019-06-17 08:49:18
【问题描述】:

如何在 TinyMCE 5 中的自定义按钮和自定义上下文工具栏上为元素添加样式(等 padding-left: 10px;)或 css 类?

这就是我到目前为止所做的:

    editor.ui.registry.addButton('addstyle', {
        icon: 'plus',
        tooltip: 'Align image left',
        onAction: 
    });


    editor.ui.registry.addContextToolbar('imagealignment', {
        predicate: function (node: any) {
            return node.nodeName.toLowerCase() === 'img'
        },
        items: 'addstyle',
        scope: 'node',
        position: 'node'
    });

我错过了在 onAction 上写什么?

【问题讨论】:

    标签: tinymce tinymce-5 custom-button


    【解决方案1】:

    您需要在该特定插件的插件源文件上编写代码

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-29
      • 1970-01-01
      • 1970-01-01
      • 2017-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-14
      相关资源
      最近更新 更多