Make WordPress Core

Changeset 41384


Ignore:
Timestamp:
09/17/2017 03:34:47 AM (7 years ago)
Author:
westonruter
Message:

Code Editor: Scroll the cursor line into view instead of the entire editor when focused.

See #41850.
Fixes #41879.

File:
1 edited

Legend:

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

    r41376 r41384  
    182182        });
    183183        codemirror.on( 'focus', function() {
    184             if ( codemirror.display.wrapper.scrollIntoViewIfNeeded ) {
    185                 codemirror.display.wrapper.scrollIntoViewIfNeeded();
     184            if ( codemirror.display.cursorDiv.scrollIntoViewIfNeeded ) {
     185                codemirror.display.cursorDiv.scrollIntoViewIfNeeded();
    186186            } else {
    187                 codemirror.display.wrapper.scrollIntoView();
     187                codemirror.display.cursorDiv.scrollIntoView();
    188188            }
    189189        });
Note: See TracChangeset for help on using the changeset viewer.