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