Committer: dpetrov
LJSUP-9668: Cannot create post after insert imageU 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-08-31 08:09:17 UTC (rev 19911) +++ trunk/htdocs/js/ck/plugins/livejournal/plugin.js 2011-08-31 08:13:37 UTC (rev 19912) @@ -383,12 +383,23 @@ } } + function checkLastLine() { + var body = editor.document.getBody(); + var last = body.getLast(); + if (last && last.type == 1 && !last.is('br')) { + body.appendHtml('<br />'); + } + } + editor.on('dataReady', function() { note = note || createNote(editor); editor.on('selectionChange', onSelectionChange); editor.document.on('mouseout', note.hide.bind(note)); editor.document.on('mouseover', onMouseOver); + editor.document.on('keyup', checkLastLine ); + editor.document.on('click', checkLastLine ); + editor.document.on('selectionChange', checkLastLine ); }); ////////// LJ User Button //////////////