WordPress.org

Make WordPress Core

Changeset 19988


Ignore:
Timestamp:
02/24/2012 10:29:46 PM (9 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js

    r19945 r19988  
    1010
    1111        init : function(ed, url) {
    12             var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML;
     12            var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick;
    1313            moreHTML = '<img src="' + url + '/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
    1414            nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
     
    278278                    ed.plugins.wordpress._hideButtons();
    279279            });
     280
     281            closeOnClick = function(e){
     282                var id;
     283
     284                if ( e.target.id == 'mceModalBlocker' || e.target.className == 'ui-widget-overlay' ) {
     285                    for ( id in ed.windowManager.windows ) {
     286                        ed.windowManager.close(null, id);
     287                    }
     288                }
     289            }
     290
     291            // close popups when clicking on the background
     292            tinymce.dom.Event.remove(document.body, 'click', closeOnClick);
     293            tinymce.dom.Event.add(document.body, 'click', closeOnClick);
    280294        },
    281295
Note: See TracChangeset for help on using the changeset viewer.