From 961a3c0850ba1053aaf8881144dc05cf27e83721 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 30 Sep 2013 09:40:47 +0000 Subject: [PATCH] keep cursor if not collapseToEnd --- source/Ox.UI/js/Form/EditableContent.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Form/EditableContent.js b/source/Ox.UI/js/Form/EditableContent.js index b9a31524..40bc271a 100644 --- a/source/Ox.UI/js/Form/EditableContent.js +++ b/source/Ox.UI/js/Form/EditableContent.js @@ -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;