diff --git a/src/js/_enqueues/admin/post.js b/src/js/_enqueues/admin/post.js
index 557465bb27..313dab3d27 100644
|
a
|
b
|
jQuery( function($) { |
| 434 | 434 | $previewField.val(''); |
| 435 | 435 | }); |
| 436 | 436 | |
| 437 | | // This code is meant to allow tabbing from Title to Post content. |
| 438 | | $('#title').on( 'keydown.editor-focus', function( event ) { |
| 439 | | var editor; |
| 440 | | |
| 441 | | if ( event.keyCode === 9 && ! event.ctrlKey && ! event.altKey && ! event.shiftKey ) { |
| 442 | | editor = typeof tinymce != 'undefined' && tinymce.get('content'); |
| 443 | | |
| 444 | | if ( editor && ! editor.isHidden() ) { |
| 445 | | editor.focus(); |
| 446 | | } else if ( $textarea.length ) { |
| 447 | | $textarea.trigger( 'focus' ); |
| 448 | | } else { |
| 449 | | return; |
| 450 | | } |
| 451 | | |
| 452 | | event.preventDefault(); |
| 453 | | } |
| 454 | | }); |
| 455 | | |
| 456 | 437 | // Auto save new posts after a title is typed. |
| 457 | 438 | if ( $( '#auto_draft' ).val() ) { |
| 458 | 439 | $( '#title' ).on( 'blur', function() { |
diff --git a/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js b/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js
index 5aa0bb76f4..4f97c599bf 100644
|
a
|
b
|
tinymce.PluginManager.add( 'wordpress', function( editor ) { |
| 1074 | 1074 | } |
| 1075 | 1075 | } ); |
| 1076 | 1076 | |
| | 1077 | editor.on( 'keydown', function( event ) { |
| | 1078 | + if ( event.keyCode === 9 && event.shiftKey ) { |
| | 1079 | + var toolbar = editor.theme.panel.find( '.toolbar:not(.menubar)' )[0]; |
| | 1080 | + if ( toolbar ) { |
| | 1081 | + toolbar.focus( true ); |
| | 1082 | + } |
| | 1083 | + } |
| | 1084 | + }); |
| | 1085 | |
| 1077 | 1086 | editor.on( 'nodechange', function( event ) { |
| 1078 | 1087 | var collapsed = editor.selection.isCollapsed(); |
| 1079 | 1088 | |
diff --git a/src/js/_enqueues/wp/editor/base.js b/src/js/_enqueues/wp/editor/base.js
index 2465af3227..3e9289398d 100644
|
a
|
b
|
window.wp = window.wp || {}; |
| 103 | 103 | |
| 104 | 104 | editorHeight = parseInt( textarea.style.height, 10 ) || 0; |
| 105 | 105 | |
| 106 | | var keepSelection = false; |
| 107 | | if ( editor ) { |
| 108 | | keepSelection = editor.getParam( 'wp_keep_scroll_position' ); |
| 109 | | } else { |
| 110 | | keepSelection = window.tinyMCEPreInit.mceInit[ id ] && |
| 111 | | window.tinyMCEPreInit.mceInit[ id ].wp_keep_scroll_position; |
| 112 | | } |
| 113 | | |
| 114 | | if ( keepSelection ) { |
| 115 | | // Save the selection. |
| 116 | | addHTMLBookmarkInTextAreaContent( $textarea ); |
| 117 | | } |
| | 106 | addHTMLBookmarkInTextAreaContent( $textarea ); |
| 118 | 107 | |
| 119 | 108 | if ( editor ) { |
| 120 | 109 | editor.show(); |
| … |
… |
window.wp = window.wp || {}; |
| 130 | 119 | } |
| 131 | 120 | } |
| 132 | 121 | |
| 133 | | if ( editor.getParam( 'wp_keep_scroll_position' ) ) { |
| 134 | | // Restore the selection. |
| 135 | | focusHTMLBookmarkInVisualEditor( editor ); |
| 136 | | } |
| | 122 | // Restore the selection. |
| | 123 | + focusHTMLBookmarkInVisualEditor( editor ); |
| 137 | 124 | } else { |
| 138 | 125 | tinymce.init( window.tinyMCEPreInit.mceInit[ id ] ); |
| 139 | 126 | } |
| … |
… |
window.wp = window.wp || {}; |
| 168 | 155 | |
| 169 | 156 | var selectionRange = null; |
| 170 | 157 | |
| 171 | | if ( editor.getParam( 'wp_keep_scroll_position' ) ) { |
| 172 | | selectionRange = findBookmarkedPosition( editor ); |
| 173 | | } |
| | 158 | selectionRange = findBookmarkedPosition( editor ); |
| 174 | 159 | |
| 175 | 160 | editor.hide(); |
| 176 | 161 | |
| … |
… |
window.wp = window.wp || {}; |
| 520 | 505 | * Focuses the selection markers in Visual mode. |
| 521 | 506 | * |
| 522 | 507 | * The method checks for existing selection markers inside the editor DOM (Visual mode) |
| 523 | | * and create a selection between the two nodes using the DOM `createRange` selection API |
| | 508 | * and create a selection between the two nodes using the DOM `createRange` selection API. |
| 524 | 509 | * |
| 525 | 510 | * If there is only a single node, select only the single node through TinyMCE's selection API |
| 526 | 511 | * |
| … |
… |
window.wp = window.wp || {}; |
| 545 | 530 | } |
| 546 | 531 | } |
| 547 | 532 | |
| 548 | | if ( editor.getParam( 'wp_keep_scroll_position' ) ) { |
| 549 | | scrollVisualModeToStartElement( editor, startNode ); |
| 550 | | } |
| | 533 | scrollVisualModeToStartElement( editor, startNode ); |
| 551 | 534 | |
| 552 | 535 | removeSelectionMarker( startNode ); |
| 553 | 536 | removeSelectionMarker( endNode ); |
diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php
index ce68a4097b..5c351bf03c 100644
|
a
|
b
|
if ( post_type_supports( $post_type, 'editor' ) ) { |
| 621 | 621 | array( |
| 622 | 622 | '_content_editor_dfw' => $_content_editor_dfw, |
| 623 | 623 | 'drag_drop_upload' => true, |
| 624 | | 'tabfocus_elements' => 'content-html,save-post', |
| 625 | 624 | 'editor_height' => 300, |
| 626 | 625 | 'tinymce' => array( |
| 627 | 626 | 'resize' => false, |
| 628 | 627 | 'wp_autoresize_on' => $_wp_editor_expand, |
| 629 | 628 | 'add_unload_trigger' => false, |
| 630 | | 'wp_keep_scroll_position' => ! $is_IE, |
| 631 | 629 | ), |
| 632 | 630 | ) |
| 633 | 631 | ); |
diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php
index 5d7ba224cc..3b20631898 100644
|
a
|
b
|
final class _WP_Editors { |
| 1113 | 1113 | 'end_container_on_empty_block' => true, |
| 1114 | 1114 | 'wpeditimage_html5_captions' => true, |
| 1115 | 1115 | 'wp_lang_attr' => get_bloginfo( 'language' ), |
| 1116 | | 'wp_keep_scroll_position' => false, |
| 1117 | 1116 | 'wp_shortcut_labels' => wp_json_encode( $shortcut_labels ), |
| 1118 | 1117 | ); |
| 1119 | 1118 | |