Vlad Kurkin (b_vladi) wrote in changelog,
Vlad Kurkin
b_vladi
changelog

[livejournal] r20109: LJSUP-9871: Need disable auto added at t...

Committer: vkurkin
LJSUP-9871: Need disable auto added at the end of text
U   trunk/htdocs/js/ck/plugins/livejournal/plugin.js
Modified: trunk/htdocs/js/ck/plugins/livejournal/plugin.js
===================================================================
--- trunk/htdocs/js/ck/plugins/livejournal/plugin.js	2011-09-22 06:58:03 UTC (rev 20108)
+++ trunk/htdocs/js/ck/plugins/livejournal/plugin.js	2011-09-22 07:28:01 UTC (rev 20109)
@@ -361,7 +361,11 @@
 				var body = editor.document.getBody();
 				var last = body.$.lastChild;
 				if (!last || last.nodeType != 1 || last.nodeName.toLowerCase() != 'br') {
+					// IE fix: LJSUP-9871;
+					var selection = editor.document.getSelection();
+					var bookmark = selection && selection.createBookmarks();
 					body.appendHtml('<br />');
+					selection && selection.selectBookmarks(bookmark);
 				}
 			}
 
@@ -394,7 +398,7 @@
 				checkLastLine();
 				editor.document.on('mouseout', note.hide);
 				editor.document.on('mouseover', findLJTags);
-				editor.document.on('keyup', checkLastLine);
+				editor.document.on('keydown', checkLastLine);
 				editor.document.on('click', checkLastLine);
 				editor.document.on('selectionChange', checkLastLine);
 				editor.document.on('afterCommandExec', checkLastLine);

Tags: b_vladi, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments