keep cursor if not collapseToEnd
This commit is contained in:
parent
a9a804887a
commit
961a3c0850
1 changed files with 4 additions and 4 deletions
|
@ -213,14 +213,14 @@ Ox.EditableContent = function(options, self) {
|
||||||
var range = document.createRange(),
|
var range = document.createRange(),
|
||||||
selection = window.getSelection();
|
selection = window.getSelection();
|
||||||
that.$element[0].focus();
|
that.$element[0].focus();
|
||||||
selection.removeAllRanges();
|
|
||||||
if (self.options.collapseToEnd) {
|
if (self.options.collapseToEnd) {
|
||||||
|
selection.removeAllRanges();
|
||||||
range.selectNodeContents(that.$element[0]);
|
range.selectNodeContents(that.$element[0]);
|
||||||
selection.addRange(range);
|
selection.addRange(range);
|
||||||
setTimeout(function() {
|
|
||||||
selection.collapseToEnd();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
setTimeout(function() {
|
||||||
|
selection.collapseToEnd();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
|
|
Loading…
Reference in a new issue