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

git-svn-id: http://svn.automattic.com/wordpress/trunk@19988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2012-02-24 22:29:46 +00:00
parent 69f037f8cc
commit a91e7ab246
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() {