Close TinyMCE popups/dialogs when clicking on the background, fixes #20117

git-svn-id: https://develop.svn.wordpress.org/trunk@19988 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2012-02-24 22:29:46 +00:00
parent 682b2a4b6d
commit d1eb773689
1 changed files with 15 additions and 1 deletions

View File

@ -9,7 +9,7 @@
mceTout : 0,
init : function(ed, url) {
var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML;
var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick;
moreHTML = '<img src="' + url + '/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
@ -277,6 +277,20 @@
if ( e.target.nodeName != 'IMG' )
ed.plugins.wordpress._hideButtons();
});
closeOnClick = function(e){
var id;
if ( e.target.id == 'mceModalBlocker' || e.target.className == 'ui-widget-overlay' ) {
for ( id in ed.windowManager.windows ) {
ed.windowManager.close(null, id);
}
}
}
// close popups when clicking on the background
tinymce.dom.Event.remove(document.body, 'click', closeOnClick);
tinymce.dom.Event.add(document.body, 'click', closeOnClick);
},
getInfo : function() {