Skip to content

Commit

Permalink
Fix for bug #69. [IE] Error thrown in console after enabling SCAYT an…
Browse files Browse the repository at this point in the history
…d trying to add new image
  • Loading branch information
egnedko committed Jul 11, 2014
1 parent 2830d19 commit 7d041f4
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,23 @@ CKEDITOR.plugins.add('scayt', {
}
};

var addMarkupStateHandlers = function() {
var editable = editor.editable();
editable.attachListener( editable, 'focus', function( evt ) {
var pluginStatus = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state[editor.name] && editor.scayt;
if (pluginStatus) {
pluginStatus.setMarkupPaused(false);
}
}, this, null, -10 );

editable.attachListener( editable, 'blur', function( evt ) {
var pluginStatus = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state[editor.name] && editor.scayt;
if (pluginStatus) {
pluginStatus.setMarkupPaused(true);
}
}, this, null, -10 );
};

var contentDomtHandler = function() {
if(inline_mode) {
editor.on( 'blur', scaytDestroy);
Expand All @@ -283,8 +300,28 @@ CKEDITOR.plugins.add('scayt', {
} else {
contentDomReady();
}

addMarkupStateHandlers();
};

editor.on( 'focus', function() {
var pluginStatus = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state[editor.name] && editor.scayt;

if ( pluginStatus ) {
pluginStatus.setMarkupPaused( false );
}

}, 0);

editor.on( 'blur', function() {
var pluginStatus = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state[editor.name] && editor.scayt;

if ( pluginStatus ) {
pluginStatus.setMarkupPaused( false );
}

}, 0);

editor.on('contentDom', contentDomtHandler);

editor.on('beforeCommandExec', function(ev) {
Expand Down

0 comments on commit 7d041f4

Please sign in to comment.