Fix timestamper widget to deal with tinyMCE

This commit is contained in:
Hadi Nategh 2018-12-13 15:15:11 +01:00
parent 486f8e0b4b
commit bde724d29f

View File

@ -110,7 +110,7 @@ var et2_timestamper = (function(){ "use strict"; return et2_button.extend([],
"standards" : (document.selection ? "ie" : false ) );
var pos = 0;
var CK = CKEDITOR && CKEDITOR.instances[input.id] || false;
var tinymce = tinyMCE && tinyMCE.EditorManager.get(input.id) || false;
// Find cursor or selection
if (browser == "ie")
@ -126,12 +126,9 @@ var et2_timestamper = (function(){ "use strict"; return et2_button.extend([],
};
// If CKEDitor, update it
if(CKEDITOR && CKEDITOR.instances[input.id])
if(tinymce)
{
CKEDITOR.instances[input.id].insertText(text);
window.setTimeout(function() {
CKEDITOR.instances[input.id].focus();
}, 10);
tinymce.insertContent(text);
}
else
{