Fix refactoring artifacts.
This commit is contained in:
parent
1a5fcb72d3
commit
ba2db48dbb
|
@ -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…
Reference in New Issue