Fix tab button on the write screen in Opera, add tabindex to the menu, don't 'lock' the tab key between the title and the editor. Fixes #8197

git-svn-id: https://develop.svn.wordpress.org/trunk@9784 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2008-11-19 12:02:28 +00:00
parent 0a86dfcc2e
commit 59ab1f6366
3 changed files with 14 additions and 13 deletions
+5 -4
View File
@@ -1528,18 +1528,19 @@ function the_editor($content, $id = 'content', $prev_id = 'title', $media_button
// <![CDATA[
edCanvas = document.getElementById('<?php echo $id; ?>');
<?php if ( user_can_richedit() && $prev_id ) { ?>
var dotabkey = true;
// If tinyMCE is defined.
if ( typeof tinyMCE != 'undefined' ) {
// This code is meant to allow tabbing from Title to Post (TinyMCE).
jQuery('#<?php echo $prev_id; ?>').keydown(function (e) {
jQuery('#<?php echo $prev_id; ?>')[jQuery.browser.opera ? 'keypress' : 'keydown'](function (e) {
if (e.which == 9 && !e.shiftKey && !e.controlKey && !e.altKey) {
if ( (jQuery("#post_ID").val() < 1) && (jQuery("#title").val().length > 0) ) { autosave(); }
if ( tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden() ) {
tinyMCE.activeEditor.focus();
if ( tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden() && dotabkey ) {
e.preventDefault();
dotabkey = false;
tinyMCE.activeEditor.focus();
return false;
}
return;
}
});
}