Consolidate "close on Escape" in the media modal, DFW, wpLink and Thickbox. Props kovshenin, fixes #26854.
Built from https://develop.svn.wordpress.org/trunk@27080 git-svn-id: http://core.svn.wordpress.org/trunk@26953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -701,15 +701,4 @@ $(document).ready( function() {
|
||||
}
|
||||
})();
|
||||
|
||||
// internal use
|
||||
$(document).bind( 'wp_CloseOnEscape', function( e, data ) {
|
||||
if ( typeof(data.cb) != 'function' )
|
||||
return;
|
||||
|
||||
if ( typeof(data.condition) != 'function' || data.condition() )
|
||||
data.cb();
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
}( jQuery, window ));
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -477,23 +477,6 @@
|
||||
a = e.altKey; // Alt key for Win & Linux
|
||||
}
|
||||
|
||||
if ( 27 == c ) { // Esc
|
||||
data = {
|
||||
event: e,
|
||||
what: 'dfw',
|
||||
cb: api.off,
|
||||
condition: function(){
|
||||
if ( $('#TB_window').is(':visible') || $('.wp-dialog').is(':visible') )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
if ( ! $(document).triggerHandler( 'wp_CloseOnEscape', [data] ) ) {
|
||||
api.off();
|
||||
}
|
||||
}
|
||||
|
||||
if ( a && (61 == c || 107 == c || 187 == c) ) { // +
|
||||
api.dfwWidth( 25 );
|
||||
e.preventDefault();
|
||||
@@ -510,6 +493,13 @@
|
||||
}
|
||||
});
|
||||
|
||||
$document.on( 'keydown.wp-fullscreen', function( event ) {
|
||||
if ( 27 === event.which && s.visible ) { // Esc
|
||||
api.off();
|
||||
event.stopImmediatePropagation();
|
||||
}
|
||||
});
|
||||
|
||||
toolbar.on( 'mouseenter', function() {
|
||||
toggleUI('show');
|
||||
}).on( 'mouseleave', function() {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user