|
@@ -23,8 +23,9 @@ export const setting = {
|
|
|
setup:function(editor){
|
|
|
editor.on('ExecCommand',function(evt) {
|
|
|
let cmd = evt.command;
|
|
|
+ console.log(cmd)
|
|
|
//设置ul/ol li的字体大小,颜色
|
|
|
- if (cmd === 'FontSize' || cmd === 'FontName' /* || cmd === 'mceApplyTextcolor' */) {
|
|
|
+ if (cmd === 'FontSize' || cmd === 'FontName' || cmd === 'mceApplyTextcolor' ) {
|
|
|
let val = evt.value;
|
|
|
let node = evt.target.selection.getNode();
|
|
|
let nodeParent = node.parentNode;
|
|
@@ -35,6 +36,9 @@ export const setting = {
|
|
|
if (cmd === 'FontName') {
|
|
|
editor.dom.setStyle(nodeParent, 'font-family', val);
|
|
|
}
|
|
|
+ if (cmd === 'mceApplyTextcolor') {
|
|
|
+ editor.dom.setStyle(nodeParent, 'color', val);
|
|
|
+ }
|
|
|
} else if (node.nodeName === 'UL' || node.nodeName === 'OL') {
|
|
|
let li = editor.dom.select('li', node);
|
|
|
if (cmd === 'FontSize') {
|
|
@@ -43,6 +47,9 @@ export const setting = {
|
|
|
if (cmd === 'FontName') {
|
|
|
editor.dom.setStyle(li, 'font-family', val);
|
|
|
}
|
|
|
+ if (cmd === 'mceApplyTextcolor') {
|
|
|
+ editor.dom.setStyle(nodeParent, 'color', val);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|