Make WordPress Core

Changeset 29884


Ignore:
Timestamp:
10/12/2014 11:11:33 PM (12 years ago)
Author:
azaozz
Message:

Quicktags: move focusing the editor after inserting content to the end of the code blocks. Fixes a bug in Chrome where both the textarea and the window may auto-scroll to unexpected position on clicking a Quicktags button. Part props avryl, fixes #29944 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/quicktags.js

    r29878 r29884  
    385385                        canvas.value = text.substring(0, startPos) + content + text.substring(endPos, text.length);
    386386
    387                         canvas.focus();
    388387                        canvas.selectionStart = startPos + content.length;
    389388                        canvas.selectionEnd = startPos + content.length;
    390389                        canvas.scrollTop = scrollTop;
     390                        canvas.focus();
    391391                } else {
    392392                        canvas.value += content;
     
    511511                        }
    512512
    513                         canvas.focus();
    514513                        canvas.selectionStart = cursorPos;
    515514                        canvas.selectionEnd = cursorPos;
    516515                        canvas.scrollTop = scrollTop;
     516                        canvas.focus();
    517517                } else { // other browsers?
    518518                        if ( !endTag ) {
Note: See TracChangeset for help on using the changeset viewer.