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

[livejournal] r20543: LJSUP-10410 Erases all data under lj-cut...

Committer: vkurkin
LJSUP-10410 Erases all data under lj-cut (ie8)
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-11-16 01:14:23 UTC (rev 20542)
+++ trunk/htdocs/js/ck/plugins/livejournal/plugin.js	2011-11-16 04:48:11 UTC (rev 20543)
@@ -655,6 +655,7 @@
 							var selection = new CKEDITOR.dom.selection(editor.document),
 								ranges = selection.getRanges();
 
+							var startContainer = selection.getRanges()[0].getTouchedStartNode().getPrevious();
 							var fragment = new CKEDITOR.dom.documentFragment(editor.document);
 
 							var iframeOpen = new CKEDITOR.dom.element('iframe', editor.document);
@@ -679,12 +680,10 @@
 							if (text != top.CKLang.ReadMore) {
 								iframeOpen.setAttribute('text', text);
 							}
-
-							var startContainer = selection.getRanges()[0].startContainer;
-							if (startContainer.type == 1 && startContainer.is('body')) {
-								startContainer.append(fragment);
-							} else {
+							if (startContainer) {
 								fragment.insertAfterNode(startContainer);
+							} else {
+								editor.document.getBody().append(fragment, true);
 							}
 						}
 

Tags: b_vladi, js, livejournal, vkurkin
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