Make WordPress Core

Changeset 30250


Ignore:
Timestamp:
11/06/2014 07:02:33 AM (10 years ago)
Author:
nacin
Message:

Quicktags: move focusing the editor after inserting content to the end of the code blocks.

Merges [29884] to the 4.0 branch.

Fixes a bug in Chrome where both the textarea and the window may auto-scroll to unexpected position on clicking a Quicktags button.

props azaozz, avryl.
fixes #29944.

Location:
branches/4.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.0

  • branches/4.0/src/wp-includes/js/quicktags.js

    r27857 r30250  
    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;
     
    510510            }
    511511
    512             canvas.focus();
    513512            canvas.selectionStart = cursorPos;
    514513            canvas.selectionEnd = cursorPos;
    515514            canvas.scrollTop = scrollTop;
     515            canvas.focus();
    516516        } else { // other browsers?
    517517            if ( !endTag ) {
Note: See TracChangeset for help on using the changeset viewer.