Hi there,
Using this code as a plugin:
Comes up with this error:
i.contentWindow is null
Any clues?
EDIT: apart from doing this:
Using this code as a plugin:
(function(){
var b='customSave';
CKEDITOR.plugins.add(b,{
init:function(c){
c.addCommand(b,a);
c.ui.addButton('CustomSave',{
label:'Save',
icon: this.path + 'icon.png',
command:b
});
}
});
var a= {
exec:function(editor){
// ajax save content
CKEDITOR.remove(editor);
editor.destroy();
editor = null;
}
}
})();Comes up with this error:
i.contentWindow is null
Any clues?
EDIT: apart from doing this:
window.onerror=function(msg, url, linenumber){
if(msg == "i.contentWindow is null") {
return true;
}
}
Re: JS error with plugin that removes the editor
You are trying to destroy the editor while it's handling an event, so that's too risky.
Re: JS error with plugin that removes the editor
(function() { var closeCmd = { modes : { wysiwyg:1, source:1 }, exec : function( editor ) { editor.config.CloseFunction(); }, async : true }; var pluginName = 'closeeditable'; CKEDITOR.plugins.add( pluginName, { init : function( editor ) { var command = editor.addCommand( pluginName, closeCmd ); editor.ui.addButton( 'CloseEditable', { label : 'Cancel & Close', command : pluginName, icon: this.path + 'images/cancel.png' }); } }); })();