'Fix' the caret position when quoting on Opera. Changelog.
This commit is contained in:
parent
07ada39342
commit
4f8cfa82d8
@ -1570,6 +1570,9 @@
|
||||
ta.value = ta.value.slice(0, caretPos) + text + ta.value.slice(ta.selectionEnd);
|
||||
ta.focus();
|
||||
range = caretPos + text.length;
|
||||
if ($.engine === 'presto') {
|
||||
range++;
|
||||
}
|
||||
ta.setSelectionRange(range, range);
|
||||
e = d.createEvent('Event');
|
||||
e.initEvent('input', true, false);
|
||||
|
||||
@ -1155,6 +1155,8 @@ QR =
|
||||
ta.focus()
|
||||
# Move the caret to the end of the new quote.
|
||||
range = caretPos + text.length
|
||||
# XXX Opera counts newlines as double
|
||||
range++ if $.engine is 'presto'
|
||||
ta.setSelectionRange range, range
|
||||
|
||||
# Fire the 'input' event
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user