Reputation: 1090
I have a window.blur
function as follows
$(window).blur(function(){
_doing_something_wrong.resume();
$('#_put_an_eye_on_users_activity_modal').modal({show : true, keyboard: false,backdrop: 'static'});
});
and TinyMCE
init
as follows
tinymce.init({
selector:'._editor_statement_question',
setup: function (_editor) {
_editor.on("focus", function () {
$(this.contentAreaContainer.parentElement).find("div.mce-toolbar-grp").show();
});
}
});
but whenever I am trying to type some content in editor
( _editor.on('focus',function(){}
) the window.blur
function is firing, I mean the modal
is showing up,
How can I avoid this only for editor focus,
I tried unbinding
the blur function, but need a simple and clean solution, some hints please
TinyMCE vesrion - 4.x
thanks
Upvotes: 2
Views: 209
Reputation: 1090
I figured it out, Its because of the TinyMCE
Iframe
, So I managed my blur
function as follows
$(window).blur(function(){
if($('iframe').is(':focus')) {
//do nothing
}
else {
_doing_something_wrong.resume();
$('#_put_an_eye_on_users_activity_modal').modal({show : true, keyboard: false,backdrop: 'static'});
}
})
Upvotes: 1