2016-05-30 112 views
2

window.blur功能烧成我有一个window.blur功能如下TinyMCE的 - 在编辑焦点

$(window).blur(function(){ 
    _doing_something_wrong.resume(); 
    $('#_put_an_eye_on_users_activity_modal').modal({show : true, keyboard: false,backdrop: 'static'}); 
}); 

TinyMCEinit如下

tinymce.init({ 
    selector:'._editor_statement_question', 
    setup: function (_editor) { 
     _editor.on("focus", function() { 
      $(this.contentAreaContainer.parentElement).find("div.mce-toolbar-grp").show(); 
     }); 
    } 
}); 

,但每当我试图键入editor一些内容(_editor.on('focus',function(){})的window.blur功能被解雇,我指的是modal被显示出来, 我怎样才能避免这种情况只为编辑焦点,

我试图unbinding残影功能,但需要一个简单而干净的解决方案,一些提示请

TinyMCE vesrion - 4.x 

感谢

回答

1

我想通了,因为TinyMCEIframe它,所以我管理我的blur功能如下

$(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'}); 
    } 
})