1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-24 15:23:11 +02:00

Some minor bug fixes in the FieldtypeComments classes and javascript.

This commit is contained in:
Ryan Cramer
2020-11-13 08:24:42 -05:00
parent c5fb4ee47b
commit e7663c7bda
4 changed files with 12 additions and 6 deletions

View File

@@ -34,6 +34,7 @@
* @property-read int $depth Current comment depth (since 3.0.149) * @property-read int $depth Current comment depth (since 3.0.149)
* @property-read bool $loaded True when comment is fully loaded from DB (since 3.0.149) * @property-read bool $loaded True when comment is fully loaded from DB (since 3.0.149)
* @property-read int $numChildren Number of children with no exclusions. See and use numChildren() method for more options. (since 3.0.154) * @property-read int $numChildren Number of children with no exclusions. See and use numChildren() method for more options. (since 3.0.154)
* @property-read User $createdUser User that created the comment
* *
*/ */

View File

@@ -111,20 +111,20 @@ class CommentFormCustom extends CommentForm {
<label class='{notify.input.label.class}'> <label class='{notify.input.label.class}'>
<input class='{notify.input.class}' type='radio' name='{notify.input.name}' checked='checked' value='{notify.input.off.value}' /> <input class='{notify.input.class}' type='radio' name='{notify.input.name}' checked='checked' value='{notify.input.off.value}' />
{notify.input.off.label} {notify.input.off.label}
<label> </label>
{if.notify.replies} {if.notify.replies}
<label class='{notify.input.label.class}'> <label class='{notify.input.label.class}'>
<input class='{notify.input.class}' type='radio' name='{notify.input.name}' value='{notify.input.replies.value}' /> <input class='{notify.input.class}' type='radio' name='{notify.input.name}' value='{notify.input.replies.value}' />
{notify.input.replies.label} {notify.input.replies.label}
<label> </label>
{endif.notify.replies} {endif.notify.replies}
{if.notify.all} {if.notify.all}
<label class='{notify.input.label.class}'> <label class='{notify.input.label.class}'>
<input class='{notify.input.class}' type='radio' name='{notify.input.name}' value='{notify.input.all.value}' /> <input class='{notify.input.class}' type='radio' name='{notify.input.name}' value='{notify.input.all.value}' />
{notify.input.all.label} {notify.input.all.label}
<label> </label>
{endif.notify.all} {endif.notify.all}
</p> </p>
{endif.notify} {endif.notify}

View File

@@ -129,23 +129,28 @@ function CommentActionReplyClick() {
// clone the main CommentForm // clone the main CommentForm
$form = jQuery('#CommentForm form').clone().removeAttr('id'); $form = jQuery('#CommentForm form').clone().removeAttr('id');
$form.addClass('CommentForm' + commentID); $form.addClass('CommentForm' + commentID);
$form.hide().find('.CommentFormParent').val($(this).attr('data-comment-id')); $form.hide().find('.CommentFormParent').val(commentID);
var $formPlaceholder = $item.find('form:eq(0)'); var $formPlaceholder = $item.find('form:not(.CommentFormReply):eq(0)');
if($formPlaceholder.length) { if($formPlaceholder.length) {
// use existing <form></form> placed in there as optional target for reply form // use existing <form></form> placed in there as optional target for reply form
$formPlaceholder.replaceWith($form); $formPlaceholder.replaceWith($form);
} else { } else {
$this.parent().after($form); $this.parent().after($form);
} }
$form.addClass('CommentFormReply');
if($form.is('form[hidden]')) { if($form.is('form[hidden]')) {
$form.removeAttr('hidden'); $form.removeAttr('hidden');
} else if(!$form.is(':visible')) { } else if(!$form.is(':visible')) {
$form.slideDown(); $form.slideDown();
} }
$form.trigger('CommentFormReplyAdd');
$form.trigger('CommentFormReplyShow');
} else if(!$form.is(':visible')) { } else if(!$form.is(':visible')) {
$form.slideDown(); $form.slideDown();
$form.trigger('CommentFormReplyShow');
} else { } else {
$form.slideUp(); $form.slideUp();
$form.trigger('CommentFormReplyHide');
} }
return false; return false;

File diff suppressed because one or more lines are too long