Fix: Hide comment seperator in comment modal if no comment is available.

This commit is contained in:
buddh4 2020-07-16 17:10:04 +02:00
parent 6976ecb54f
commit 54b303b772

View File

@ -10,21 +10,25 @@ use humhub\modules\comment\widgets\Form;
?>
<?php ModalDialog::begin(['header' => Yii::t('CommentModule.base', 'Comments')]) ?>
<div class="modal-body comment-container comment-modal-body" style="margin-top:0px">
<div id="userlist-content">
<div class="well well-small" id="comment_<?= $id; ?>">
<div class="comment" id="comments_area_<?= $id; ?>">
<?= $output; ?>
<div class="modal-body comment-container comment-modal-body" style="margin-top:0">
<div id="userlist-content">
<div class="well well-small" id="comment_<?= $id ?>">
<div class="comment" id="comments_area_<?= $id ?>">
<?= $output ?>
</div>
<?= Form::widget(['object' => $object]); ?>
</div>
<?= Form::widget(['object' => $object]); ?>
</div>
</div>
</div>
<?php ModalDialog::end() ?>
<script <?= Html::nonce() ?>>
// scroll to top of list
$(".comment-modal-body").animate({scrollTop: 0}, 200);
<?php if(empty(trim($output))) : ?>
$('#comment_<?= $id ?>').find('.comment_create hr').hide();
<?php endif; ?>
</script>