mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
Fix refactoring artifacts.
This commit is contained in:
parent
1a5fcb72d3
commit
ba2db48dbb
1 changed files with 2 additions and 2 deletions
|
@ -537,14 +537,14 @@ export default Ember.Component.extend({
|
||||||
// Remember cursor/selection.
|
// Remember cursor/selection.
|
||||||
const selectionStart = textarea.selectionStart;
|
const selectionStart = textarea.selectionStart;
|
||||||
const selectionEnd = textarea.selectionEnd;
|
const selectionEnd = textarea.selectionEnd;
|
||||||
const needleEnd = needleStart + oldValue.length;
|
const needleEnd = needleStart + oldVal.length;
|
||||||
const replacementEnd = needleStart + newVal.length;
|
const replacementEnd = needleStart + newVal.length;
|
||||||
|
|
||||||
// Replace value (side effect: cursor at end).
|
// Replace value (side effect: cursor at end).
|
||||||
this.set('value', val.replace(oldVal, newVal));
|
this.set('value', val.replace(oldVal, newVal));
|
||||||
|
|
||||||
// Determine cursor/selection.
|
// Determine cursor/selection.
|
||||||
const newSelectionStart, newSelectionEnd;
|
let newSelectionStart, newSelectionEnd;
|
||||||
if (selectionEnd <= needleEnd) {
|
if (selectionEnd <= needleEnd) {
|
||||||
// Selection before needle.
|
// Selection before needle.
|
||||||
newSelectionStart = selectionStart;
|
newSelectionStart = selectionStart;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue