Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 1e80fe8

Browse files
committed
Fixed incorrect display of comment form
The comment form now appears at the bottom. I also I fixed a big where if you opened and closed a comment reply block bad things would happen.
1 parent 97cd6c5 commit 1e80fe8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Resources/public/js/Zikula.EZComments.GetComments.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
this.getUserId();
2222
this.$comForm.addClass('d-none');
2323
this.setUpMessageDialog();
24+
//Show an initial new comment
25+
this.newComment(null);
2426
},
2527
cacheDom: function () {
2628
this.$comForm = $('#commentFormDiv');
@@ -99,6 +101,7 @@
99101
delete this.subComments[this.currentId];
100102
}
101103
this.clearAndHideForm();
104+
this.newComment(null);
102105
} else {
103106
$('#' + itemName).removeClass('fa-caret-square-left');
104107
$('#' + itemName).addClass('fa-caret-square-down');
@@ -299,6 +302,7 @@
299302
currForm.before(divBlock);
300303
}
301304
this.clearAndHideForm();
305+
this.newComment(null);
302306
},
303307
hookUpButtons: function (target, result) {
304308
//only add these buttons if the user id is the same
@@ -329,7 +333,7 @@
329333
var currForm = this.$comForm;
330334
currForm.find('textarea').val('');
331335
currForm.find('input[name=subject]').val('');
332-
currForm.addClass('d-none');
336+
//currForm.addClass('d-none');
333337
},
334338

335339
cancelComment :function(evt) {

Resources/views/Hook/ezcomments_hook_uiview.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
</p>
5353
{% endif %}
5454
</div>
55-
</div>
5655
<div id="commentFormDiv">
5756
<div class="comment_form" id="comment_0">
5857
<form id="commentForm" action="{{ path('zikulaezcommentsmodule_comment_comment') }}" method="post"
@@ -116,6 +115,7 @@
116115
</form>
117116
</div>
118117
</div>
118+
</div>
119119
<div class="alert alert-danger d-none" id="no_replies">{% trans %}No replies to show!{% endtrans %}</div>
120120

121121
<div id="dialog-message" title="{{ 'There was a problem with your comment?'|trans|e('html_attr') }}">

0 commit comments

Comments
 (0)