diff --git a/wp-admin/js/common.dev.js b/wp-admin/js/common.dev.js index d54584315e..b864055a86 100644 --- a/wp-admin/js/common.dev.js +++ b/wp-admin/js/common.dev.js @@ -321,10 +321,24 @@ $(document).ready( function() { // tab in textareas $('#newcontent').bind('keydown.wpevent_InsertTab', function(e) { - if ( e.keyCode != 9 ) - return true; + var el = e.target, selStart, selEnd, val, scroll, sel; - var el = e.target, selStart = el.selectionStart, selEnd = el.selectionEnd, val = el.value, scroll, sel; + if ( e.keyCode == 27 ) { // escape key + $(el).data('tab-out', true); + return; + } + + if ( e.keyCode != 9 || e.ctrlKey || e.altKey || e.shiftKey ) // tab key + return; + + if ( $(el).data('tab-out') ) { + $(el).data('tab-out', false); + return; + } + + selStart = el.selectionStart; + selEnd = el.selectionEnd; + val = el.value; try { this.lastKey = 9; // not a standard DOM property, lastKey is to help stop Opera tab event. See blur handler below. diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index b7758d225d..75417a6c80 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -226,7 +226,8 @@ foreach ( $plugin_files as $plugin_file ) :
-
+
+ @@ -256,12 +257,10 @@ foreach ( $plugin_files as $plugin_file ) :
-
- - - - -
+
+ + + + + +