How to change the background color of container in CKEditor with color palette

╄→尐↘猪︶ㄣ 提交于 2019-12-12 03:43:48

问题


How to change the color of the container with inline ckeditor from the list of colors.I know we have "colorbutton" plugin to change the text color and background color of block element but I need to change the entire container color. Here is the image about my requirement


回答1:


Modified the colorbutton button ckeditor plugin. Add the following conditions in renderColors() method.

if(type != 'back'){
 editor.applyStyle( new CKEDITOR.style( colorStyle, { color: color } ) );   
}else{
  editor.container.$.style.backgroundColor=color;
}


来源:https://stackoverflow.com/questions/40131426/how-to-change-the-background-color-of-container-in-ckeditor-with-color-palette

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!