Fixed multiple comment posting and removed container height limit.
This commit is contained in:
parent
fa951c5da2
commit
9bd1d3e910
3 changed files with 9 additions and 9 deletions
|
@ -4,8 +4,12 @@
|
|||
word-wrap: break-word;
|
||||
|
||||
&__listing {
|
||||
max-height: 600px;
|
||||
overflow-y: auto;
|
||||
|
||||
&--limit {
|
||||
--comments-max-height: 600px;
|
||||
max-height: var(--comments-max-height);
|
||||
}
|
||||
}
|
||||
|
||||
&__input,
|
||||
|
|
|
@ -10,8 +10,7 @@ function commentsRequestLock(): boolean
|
|||
if (commentsLocked())
|
||||
return false;
|
||||
|
||||
globalCommentLock = true;
|
||||
return true;
|
||||
return globalCommentLock = true;
|
||||
}
|
||||
|
||||
function commentsFreeLock(): void
|
||||
|
|
|
@ -208,14 +208,11 @@
|
|||
|
||||
{% if perms.can_comment %}
|
||||
<script>
|
||||
var commentPostLock = false;
|
||||
|
||||
function commentPost(ev)
|
||||
{
|
||||
// the moment we find the id we engage vote lock
|
||||
if (commentPostLock)
|
||||
if (!commentsRequestLock())
|
||||
return;
|
||||
commentPostLock = true;
|
||||
|
||||
var form = ev.target,
|
||||
formData = new FormData;
|
||||
|
@ -237,6 +234,8 @@
|
|||
if (this.readyState !== 4)
|
||||
return;
|
||||
|
||||
commentsFreeLock();
|
||||
|
||||
var json = JSON.parse(this.responseText),
|
||||
message = json.error || json.message;
|
||||
|
||||
|
@ -247,8 +246,6 @@
|
|||
form.parentNode.parentNode.querySelector('label.comment__action').click();
|
||||
commentInsert(json, form);
|
||||
}
|
||||
|
||||
commentPostLock = false;
|
||||
};
|
||||
|
||||
xhr.open('POST', '/comments.php?m=create');
|
||||
|
|
Loading…
Add table
Reference in a new issue