AntonLV 5 лет назад
Родитель
Сommit
c8094bbe53
3 измененных файлов с 14 добавлено и 2 удалено
  1. 9 1
      inc/js/classes/BxDolCmts.js
  2. 1 1
      template/comments_block.html
  3. 4 0
      template/scripts/BxBaseCmts.php

+ 9 - 1
inc/js/classes/BxDolCmts.js

@@ -217,6 +217,14 @@ BxDolCmts.prototype.cmtPin = function(oLink, iCmtId, iWay, bHideMenu) {
 
                         $this._sDisplayType = $this._sDisplayType;
                         $this._cmtsReplaceContent($(sListId), sContent);
+
+                        var oDivider = $(sListId).siblings('.cmts-divider');
+                        if(oDivider.length > 0) {
+                            if(oDivider.is(':hidden') && sContent.length != 0)
+                                oDivider.show();
+                            else if(!oDivider.is(':hidden') && sContent.length == 0)
+                                oDivider.hide();
+                        }
                     });
             	}
             };
@@ -658,7 +666,7 @@ BxDolCmts.prototype._getCmt = function (e, iCmtId)
         function (oData) {
             $this._loadingInBlock (e, false);
 
-            var sListId = $this._sRootId + ' #cmt' + oData.vparent_id + ' > ul';
+            var sListId = $this._sRootId + ' #cmt' + oData.vparent_id + ' > ul.cmts-all';
             var sReplyFormId = $this._sRootId + ' #cmt' + oData.parent_id + ' > .cmt-reply';
 
             //--- Hide reply form ---//

+ 1 - 1
template/comments_block.html

@@ -4,7 +4,7 @@
         __content_before__
         <a id="__list_anchor__" class="bx-anchor-invisible"></a>
         <ul class="cmts cmts-pinned">__comments_pinned__</ul>
-        <div class="bx-def-hr"></div>
+        <div class="cmts-divider bx-def-hr" style="<bx_if:show_divider_hidden>display:none</bx_if:show_divider_hidden>"></div>
         <ul class="cmts cmts-all">__comments__</ul>
         __content_after__
     </div>

+ 4 - 0
template/scripts/BxBaseCmts.php

@@ -175,6 +175,10 @@ class BxBaseCmts extends BxDolCmts
             'content_before' => $sContentBefore,
             'comments' => $sComments,
             'comments_pinned' => $sCommentsPinned,
+            'bx_if:show_divider_hidden' => array(
+                'condition' => empty($sCommentsPinned),
+                'content' => array()
+            ),
             'content_after' => $sContentAfter,
             'post_form_top' => $sPostFormTop,
             'post_form_bottom'  => $sPostFormBottom,