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

[livejournal] r20589: LJSUP-10427: lj-cut was moving to the st...

Committer: vkurkin
LJSUP-10427: lj-cut was moving to the start of post
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-21 15:21:43 UTC (rev 20588)
+++ trunk/htdocs/js/ck/plugins/livejournal/plugin.js	2011-11-21 15:51:53 UTC (rev 20589)
@@ -287,14 +287,16 @@
 					this.setStyle('height', doc.body.scrollHeight + 'px');
 				}
 
-				var body = new CKEDITOR.dom.element.get(doc.body);
-				body.on('dblclick', onDoubleClick);
-				body.on('click', onClickFrame);
-				body.on('keyup', onKeyUp);
+				var iframeBody = new CKEDITOR.dom.element.get(doc.body);
+				if(iframeBody.on) {
+					iframeBody.on('dblclick', onDoubleClick);
+					iframeBody.on('click', onClickFrame);
+					iframeBody.on('keyup', onKeyUp);
+				}
 
 				doc = new CKEDITOR.dom.element.get(doc);
 
-				doc.frame = body.frame = this;
+				doc.frame = iframeBody.frame = this;
 			}
 
 			function updateFrames() {
@@ -703,6 +705,7 @@
 							iframeClose.setAttribute('frameBorder', 0);
 							iframeClose.setAttribute('allowTransparency', 'true');
 
+							selection.lock();
 							if (ranges[0].collapsed === true) {
 								editor.insertElement(iframeClose);
 								iframeClose.insertBeforeMe(iframeOpen);
@@ -717,6 +720,7 @@
 								editor.insertElement(iframeClose);
 								iframeClose.insertBeforeMe(fragment);
 							}
+							selection.unlock();
 						}
 
 						CKEDITOR.note && CKEDITOR.note.hide(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