How to remove the “title” attribute that the CKEdi

2019-01-26 12:11发布

When using CKEditor 4 Inline Editing on a object the CKEditor add a "Title" attribute that include a text and the object id.

e.g. In the CKEditor inline example we can see the next code:

<h2 id="inline-sampleTitle" title="Rich Text Editor, inline-sampleTitle"....>CKEditor<br>Goes Inline!</h2>

I like to remove the "title" attribute because i do not like the user to see it (my id is more complicated :) ).

Note: I was trying to remove it manually after the CKEditor create it using jQuery "removeAttr" function but this solution is not really good for me because in IE browsers the user still see it in the first time and it will remove only after the user mouse out from the object.

9条回答
Rolldiameter
2楼-- · 2019-01-26 12:15

in your config

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here.
    // For the complete reference:
    // http://docs.ckeditor.com/#!/api/CKEDITOR.config
    config.title="";
}
查看更多
劳资没心,怎么记你
3楼-- · 2019-01-26 12:19

CKEDITOR.config.title = false;

For More Details Visit this

查看更多
冷血范
4楼-- · 2019-01-26 12:20

I have tried using

CKEDITOR.config.title = false;

but it still persist showing title.

After some research, what I done is:

1.Go to ~/ckeditor/lang/en-gb.js remove out 'editorHelp' value

2.Assign language and title, same as below:

CKEDITOR.editorConfig = function( config ) {
config.language="en-gb";
config.title="Put your title here"; //cannot put blank, it will display "null"
查看更多
孤傲高冷的网名
5楼-- · 2019-01-26 12:22

CKEditor fix it in version 4.2 so we can remove this fix now :) http://dev.ckeditor.com/ticket/10042

查看更多
时光不老,我们不散
6楼-- · 2019-01-26 12:28

See https://stackoverflow.com/a/15270613/2148773 - looks like you can manually set the "title" attribute of the editor element to override the tooltip.

查看更多
叛逆
7楼-- · 2019-01-26 12:32

You can find here some details: How can I change the title ckeditor sets for inline instances?

Unfortunately, you cannot change it without modifying the code. I reported ticket for this http://dev.ckeditor.com/ticket/10042

查看更多
登录 后发表回答