Open porjo opened 6 years ago
For inline editor toggleShow works in 4.5.10 version :
var editor = CKEDITOR.inline(editorId, config);
editor.on(LITE.Events.INIT, function (event) {
var lite = event.data.lite;
lite.toggleTracking(true, false);
lite.toggleShow(false, false);
});
I've found that if I wrap the editor.on()
in a setTimeout() of 3 seconds e.g.
var editor = CKEDITOR.inline(editorId, config);
setTimeout(function() {
editor.on(LITE.Events.INIT, function (event) {
var lite = event.data.lite;
lite.toggleTracking(true, false);
lite.toggleShow(false, false);
});
},3000);
it works as required - otherwise I get LITE is not defined
error. I have many other ckeditor instances on the same page, so I'm guessing it is taking a long time for everything to be ready. What is a better way to handle that?
EDIT: I came up with this workaround
var liteCheck = setInterval(function () {
if(typeof LITE !== "undefined" ) {
editor.on( LITE.Events.INIT, function( evt ) {
evt.data.lite.toggleShow(false, false);
});
clearInterval(liteCheck);
}
}, 100);
I'd like to enable tracking, but have the changes hidden by default. It's not clear how I would achieve this.
Could an
isVisible
config option be added to complement the existingisTracking
option?My attempts to use
toggleShow()
after initialization have failed. Listening forLITE.Events.INIT
fails withLITE is not defined
e.g.Finding the plugin instance from the editor instance fails with
this._tracker is null
e.g.(using Ckeditor 4.6.2 with bundled track changes plugin)