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

[livejournal] r20053: LJSUP-9805: Lj-cut removes the data (Ope...

Committer: vkurkin
LJSUP-9805: Lj-cut removes the data (Opera 11.10)
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-16 05:33:22 UTC (rev 20052)
+++ trunk/htdocs/js/ck/plugins/livejournal/plugin.js	2011-09-16 05:45:36 UTC (rev 20053)
@@ -360,7 +360,7 @@
 				}
 				var body = editor.document.getBody();
 				var last = body.$.lastChild;
-				if (last && last.nodeType == 1 && last.nodeName.toLowerCase() != 'br') {
+				if (!last || last.nodeType != 1 || last.nodeName.toLowerCase() != 'br') {
 					body.appendHtml('<br />');
 				}
 			}
@@ -778,7 +778,8 @@
 							selection.lock();
 							for (var i = 0, l = ranges.length; i < l; i++) {
 								var range = ranges[i];
-								range.extractContents().appendTo(ljNoteData.LJCut.node);
+								range.cloneContents().appendTo(ljNoteData.LJCut.node);
+								range.deleteContents();
 							}
 							selection.unlock();
 							editor.insertElement(ljNoteData.LJCut.node);

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