Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 64e455c

Browse files
committed
Also remove scrollToCaretPosition from insertRefIntoMWEditBox. Instead, call highlightLengthAtIndex, using values from getCaretPosition.
--HG-- extra : rebase_source : e7ebeab8cb4a9aef2ebef1debee1861e2acfc6a8
1 parent 5457ade commit 64e455c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ProveIt_Wikipedia.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,12 @@ window.proveit = jQuery.extend({
344344
{
345345
peri: insertionText,
346346
replace: true
347-
}).textSelection('scrollToCaretPosition', {force: true});
347+
});
348+
var caretPos = txtarea.textSelection('getCaretPosition', {startAndEnd: true});
349+
350+
// This is slightly redundant. It is called primarily for the scrollig workaround
351+
this.highlightLengthAtIndex(caretPos[0], caretPos[1] - caretPos[0]);
352+
348353
this.includeProveItEditSummary();
349354
},
350355

0 commit comments

Comments
 (0)