keep cursor if not collapseToEnd

This commit is contained in:
j 2013-09-30 09:40:47 +00:00
parent a9a804887a
commit 961a3c0850

View file

@ -213,14 +213,14 @@ Ox.EditableContent = function(options, self) {
var range = document.createRange(),
selection = window.getSelection();
that.$element[0].focus();
selection.removeAllRanges();
if (self.options.collapseToEnd) {
selection.removeAllRanges();
range.selectNodeContents(that.$element[0]);
selection.addRange(range);
setTimeout(function() {
selection.collapseToEnd();
});
}
setTimeout(function() {
selection.collapseToEnd();
});
}
return that;