can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r21819: LJSUP-11820: Add ability to add photos f...

Committer: dpetrov
LJSUP-11820: Add ability to add photos from album
U   trunk/htdocs/js/entry.js
Modified: trunk/htdocs/js/entry.js
===================================================================
--- trunk/htdocs/js/entry.js	2012-04-26 13:49:57 UTC (rev 21818)
+++ trunk/htdocs/js/entry.js	2012-04-26 14:03:57 UTC (rev 21819)
@@ -911,16 +911,14 @@
 	function onHtmlReady(event) {
 		if (window.switchedRteOn) {
 			var editor = CKEDITOR.instances.draft;
-			for (var i = 0, l = event.htmlStrings.length; i < l; i++) {
-				editor.insertElement(new CKEDITOR.dom.element.createFromHtml(event.htmlStrings[i], editor.document));
-			}
+			editor.insertHtml(event.htmlStrings.join('<br />'));
 		} else {
 			var selection = DOM.getSelectedRange($('draft'));
 			var node = $('draft');
 			var value = node.value;
 			var start = value.substring(0, selection.start);
 			var end = value.substring(selection.end);
-			node.value = start + event.htmlStrings.join('') + end;
+			node.value = start + event.htmlStrings.join('\n') + end;
 		}
 	}
 

Tags: can3p, dpetrov, 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