mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
synced 2024-11-12 01:09:49 +00:00
Scroll the textbox to selection (error location) on page load
Only doing 'setSelection' doesn't guarantee that the textbox will be scrolled (it works on Firefox and Edge, but not on Chrome and IE). Bug: T152760 Change-Id: I3fab6363cd432d137430884eaca3555a7bf5aafa
This commit is contained in:
parent
86620b72be
commit
d18262cfa1
|
@ -6,6 +6,7 @@ $( function () {
|
|||
if ( location ) {
|
||||
if ( $textbox.length ) {
|
||||
$textbox.trigger( 'focus' ).textSelection( 'setSelection', { start: location[ 0 ], end: location[ 1 ] } );
|
||||
$textbox.textSelection( 'scrollToCaretPosition' );
|
||||
}
|
||||
mw.hook( 've.tempWikitextReady' ).add( function () {
|
||||
mw.libs.ve.tempWikitextEditor.$element[ 0 ].setSelectionRange(
|
||||
|
|
Loading…
Reference in a new issue