WordPress.org

Make WordPress Core

Changeset 29692


Ignore:
Timestamp:
09/03/2014 09:37:01 AM (5 years ago)
Author:
nacin
Message:

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

fixes #29485.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/editor-expand.js

    r29656 r29692  
    196196            }
    197197
     198            // Bail on special keys.
     199            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 ) ) {
     200                return;
     201            // OS keys, function keys, num lock, scroll lock
     202            } else if ( ( key >= 91 && key <= 93 ) || ( key >= 112 && key <= 123 ) || key === 144 || key === 145 ) {
     203                return;
     204            }
     205
    198206            cursorTop = offset.top + editor.iframeElement.getBoundingClientRect().top;
    199207            cursorBottom = cursorTop + offset.height;
Note: See TracChangeset for help on using the changeset viewer.