Editor scrolling: Avoid jumping to the cursor when modifier and scrolling keys are pressed.

fixes #29485.

Built from https://develop.svn.wordpress.org/trunk@29692


git-svn-id: http://core.svn.wordpress.org/trunk@29467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-09-03 09:38:16 +00:00
parent 9db108dbe0
commit 0f73f0bea3
2 changed files with 9 additions and 1 deletions

View File

@ -195,6 +195,14 @@ jQuery( document ).ready( function($) {
return;
}
// Bail on special keys.
if ( key <= 47 && ! ( key === VK.SPACEBAR || key === VK.ENTER || key === VK.DELETE || key === VK.BACKSPACE || key === VK.UP || key === VK.LEFT || key === VK.DOWN || key === VK.UP ) ) {
return;
// OS keys, function keys, num lock, scroll lock
} else if ( ( key >= 91 && key <= 93 ) || ( key >= 112 && key <= 123 ) || key === 144 || key === 145 ) {
return;
}
cursorTop = offset.top + editor.iframeElement.getBoundingClientRect().top;
cursorBottom = cursorTop + offset.height;
cursorTop = cursorTop - buffer;

File diff suppressed because one or more lines are too long