diff --git wp-admin/js/wp-fullscreen.dev.js wp-admin/js/wp-fullscreen.dev.js
index e9678c9..9e15344 100644
|
|
|
4 | 4 | * A lightweight publish/subscribe implementation. |
5 | 5 | * Private use only! |
6 | 6 | */ |
7 | | var PubSub, fullscreen, wptitlehint; |
| 7 | var PubSub, fullscreen, wptitlehint, wpDialogOpen = false; |
8 | 8 | |
9 | 9 | PubSub = function() { |
10 | 10 | this.topics = {}; |
… |
… |
PubSub.prototype.publish = function( topic, args ) { |
486 | 486 | else |
487 | 487 | a = e.altKey; // Alt key for Win & Linux |
488 | 488 | |
489 | | if ( 27 == c ) // Esc |
490 | | fullscreen.off(); |
491 | 489 | |
492 | 490 | if ( a && (61 == c || 187 == c) ) // + |
493 | 491 | api.dfw_width(25); |
… |
… |
PubSub.prototype.publish = function( topic, args ) { |
501 | 499 | return true; |
502 | 500 | }); |
503 | 501 | |
| 502 | $(document).keydown(function(e){ |
| 503 | var c = e.charCode || e.keyCode; |
| 504 | |
| 505 | // The Esc key check has to be in keydown since Thickbox and tinyMCE's wpDialog |
| 506 | // all handle Esc presses on keydown. |
| 507 | if ( 27 == c && ! wpDialogOpen ) { // Esc |
| 508 | fullscreen.off(); |
| 509 | } |
| 510 | }); |
| 511 | |
504 | 512 | topbar.mouseenter(function(e){ |
505 | 513 | s.toolbars.addClass('fullscreen-make-sticky'); |
506 | 514 | $( document ).unbind( '.fullscreen' ); |
diff --git wp-includes/js/thickbox/thickbox.js wp-includes/js/thickbox/thickbox.js
index d4b3710..f367d77 100644
|
|
if ( typeof tb_closeImage != 'string' ) { |
14 | 14 | |
15 | 15 | /*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/ |
16 | 16 | |
| 17 | var wpDialogOpen = false; |
| 18 | |
17 | 19 | //on page load call tb_init |
18 | 20 | jQuery(document).ready(function(){ |
19 | 21 | tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox |
… |
… |
function tb_click(){ |
36 | 38 | } |
37 | 39 | |
38 | 40 | function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link |
| 41 | wpDialogOpen = true; |
39 | 42 | |
40 | 43 | try { |
41 | 44 | if (typeof document.body.style.maxHeight === "undefined") {//if IE 6 |
… |
… |
function tb_remove() { |
283 | 286 | } |
284 | 287 | document.onkeydown = ""; |
285 | 288 | document.onkeyup = ""; |
| 289 | |
| 290 | // Add a small timeout just to ensure that code that checks wpDialogOpen can |
| 291 | // run before the variable is updated. |
| 292 | setTimeout( 'wpDialogOpen = false;', 100 ); |
| 293 | |
286 | 294 | return false; |
287 | 295 | } |
288 | 296 | |
diff --git wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.dev.js
index 620213f..8b4d459 100644
|
|
|
| 1 | var wpDialogOpen = false; |
| 2 | |
1 | 3 | (function($){ |
2 | 4 | $.widget("wp.wpdialog", $.ui.dialog, { |
3 | 5 | open: function() { |
… |
… |
|
13 | 15 | return; |
14 | 16 | } |
15 | 17 | |
| 18 | wpDialogOpen = true; |
| 19 | |
16 | 20 | // Open the dialog. |
17 | 21 | $.ui.dialog.prototype.open.apply( this, arguments ); |
18 | 22 | // WebKit leaves focus in the TinyMCE editor unless we shift focus. |
19 | 23 | this.element.focus(); |
20 | 24 | this._trigger('refresh'); |
| 25 | }, |
| 26 | |
| 27 | close: function() { |
| 28 | $.ui.dialog.prototype.close.apply( this, arguments ); |
| 29 | |
| 30 | // Add a small timeout just to ensure that code that checks wpDialogOpen can |
| 31 | // run before the variable is updated. |
| 32 | setTimeout( 'wpDialogOpen = false;', 100 ); |
21 | 33 | } |
22 | 34 | }); |
23 | 35 | })(jQuery); |