CKEditor-当没有选择组合框样式时如何应用默认样式

时间:2018-12-12 07:07:55

标签: javascript ckeditor

我将CKEditor与这样的自定义dorpdown样式一起使用

 var myStyles = [
            // BLOCK STYLES
            {name: 'Heading 1', element: 'h1'},
            {name: 'Heading 2', element: 'h2'},
            {name: 'Heading 3', element: 'h3'},
            {name: '2 column', element: 'div', attributes: {'class': 'col2'}},
            // INLINE STYLES
            {name: 'Button', element: 'a', attributes: {'class': 'button'}},
            {name: 'Button-outline', element: 'a', attributes: {'class': 'button-outline'}},
            {name: 'Paragraph', element: 'p', attributes: {'class': ''}},
            {name: 'Paragraph: no space after', element: 'p', attributes: {'class': 'no-space-after'}},
            {name: 'Paragraph: small space after', element: 'p', attributes: {'class': 'small-space-after'}},
            {name: 'Paragraph: large space after', element: 'p', attributes: {'class': 'large-space-after'}},
            {name: 'List: upper-roman', element: 'ol', attributes: {'data-list-style': 'upper-roman'}},
            {name: 'List: decimal leading zero', element: 'ol', attributes: {'data-list-style': 'decimal-leading-zero'}},
];

当没有其他选项被选中时,我希望将其中一种作为默认选项。

我尝试过

  KEDITOR.instances[idEditor].applyStyle('Paragraph');

但是它不起作用。

谢谢

0 个答案:

没有答案