Skip to content

Commit

Permalink
Ticket #4542 - Comments: Insert newly posted comment near post form.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed Nov 7, 2023
1 parent e806b2f commit 684555c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions inc/js/classes/BxDolCmts.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,20 @@ BxDolCmts.prototype._getCmt = function (e, iCmtId)

$(sListId).each(function() {
//--- Some number of comments already loaded ---//
if($(this).children('li.cmt').length)
$(this).children('li.cmt:last').after($(oData.content).hide()).next('li.cmt:hidden').bxProcessHtml().bx_anim('toggle', $this._sAnimationEffect, $this._iAnimationSpeed);
if($(this).children('li.cmt').length) {
var oAdded = null;
switch($this._sPostFormPosition) {
case 'top':
oAdded = $(this).children('li.cmt:first').before($(oData.content).hide()).prev('li.cmt:hidden');
break;

case 'bottom':
oAdded = $(this).children('li.cmt:last').after($(oData.content).hide()).next('li.cmt:hidden');
break;
}

oAdded.bxProcessHtml().bx_anim('toggle', $this._sAnimationEffect, $this._iAnimationSpeed);
}
//-- There is no comments at all ---//
else
$(this).hide().html(oData.content).bxProcessHtml().bx_anim('show', $this._sAnimationEffect, $this._iAnimationSpeed);
Expand Down

0 comments on commit 684555c

Please sign in to comment.