2016-05-30 106 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'}); 
    } 
})