[livejournal] r21041: LJSUP-11059: Move commenting form under ...
Committer: dpetrov
LJSUP-11059: Move commenting form under commentU trunk/htdocs/js/quickreply.js
Modified: trunk/htdocs/js/quickreply.js
===================================================================
--- trunk/htdocs/js/quickreply.js 2012-01-30 08:48:17 UTC (rev 21040)
+++ trunk/htdocs/js/quickreply.js 2012-01-30 09:00:00 UTC (rev 21041)
@@ -29,14 +29,15 @@
} else if (QuickReply.lastDiv != dtid) {
}
- var comments = $('comments');
+ var comments = $('comments'),
+ targetcomment = $(targetcomment);
//LJSUP-11059: when we show old style entry page, comment form should be placed under comment with
//shift according to its depth.
- if (!comments || comments.className.indexOf('entry-comments-s1') === -1) {
+ if (!comments || comments.className.indexOf('entry-comments-s1') === -1 || !targetcomment) {
cur_div.parentNode.insertBefore(qr_div, cur_div);
} else {
- $(targetcomment).appendChild(qr_div);
+ targetcomment.appendChild(qr_div);
}
QuickReply.lastDiv = targetname;
