mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 14:13:54 +00:00
Semi-working IE support for selecting the location of a syntax error.
This commit is contained in:
parent
792c7d0be6
commit
ebafabc610
9
edit.js
9
edit.js
|
@ -28,10 +28,15 @@ function processSyntaxResult( request ) {
|
|||
var position = charArray[1];
|
||||
var textArea = document.getElementById( wgFilterBoxName );
|
||||
|
||||
if (textArea.selectionStart && textArea.selectionEnd) {
|
||||
textArea.focus();
|
||||
if (document.selection) {
|
||||
var sel = document.selection.createRange();
|
||||
sel.moveStart( 'character', -textArea.value.length );
|
||||
sel.moveStart( 'character', position );
|
||||
sel.select();
|
||||
} else if (textArea.selectionStart && textArea.selectionEnd) {
|
||||
textArea.selectionStart = position;
|
||||
textArea.selectionEnd = position;
|
||||
textArea.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue