mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-29 22:29:57 +00:00
Merge branch 'v23-08' into development
This commit is contained in:
commit
ec86576e1e
1 changed files with 6 additions and 8 deletions
|
@ -27,16 +27,12 @@ export class PageComments extends Component {
|
||||||
|
|
||||||
// Internal State
|
// Internal State
|
||||||
this.parentId = null;
|
this.parentId = null;
|
||||||
this.formReplyText = this.formReplyLink.textContent;
|
this.formReplyText = this.formReplyLink?.textContent || '';
|
||||||
|
|
||||||
this.setupListeners();
|
this.setupListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
setupListeners() {
|
setupListeners() {
|
||||||
this.removeReplyToButton.addEventListener('click', this.removeReplyTo.bind(this));
|
|
||||||
this.hideFormButton.addEventListener('click', this.hideForm.bind(this));
|
|
||||||
this.addCommentButton.addEventListener('click', this.showForm.bind(this));
|
|
||||||
|
|
||||||
this.elem.addEventListener('page-comment-delete', () => {
|
this.elem.addEventListener('page-comment-delete', () => {
|
||||||
this.updateCount();
|
this.updateCount();
|
||||||
this.hideForm();
|
this.hideForm();
|
||||||
|
@ -47,6 +43,9 @@ export class PageComments extends Component {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.form) {
|
if (this.form) {
|
||||||
|
this.removeReplyToButton.addEventListener('click', this.removeReplyTo.bind(this));
|
||||||
|
this.hideFormButton.addEventListener('click', this.hideForm.bind(this));
|
||||||
|
this.addCommentButton.addEventListener('click', this.showForm.bind(this));
|
||||||
this.form.addEventListener('submit', this.saveComment.bind(this));
|
this.form.addEventListener('submit', this.saveComment.bind(this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,9 +122,8 @@ export class PageComments extends Component {
|
||||||
this.showForm();
|
this.showForm();
|
||||||
this.parentId = commentLocalId;
|
this.parentId = commentLocalId;
|
||||||
this.replyToRow.toggleAttribute('hidden', false);
|
this.replyToRow.toggleAttribute('hidden', false);
|
||||||
const replyLink = this.replyToRow.querySelector('a');
|
this.formReplyLink.textContent = this.formReplyText.replace('1234', this.parentId);
|
||||||
replyLink.textContent = this.formReplyText.replace('1234', this.parentId);
|
this.formReplyLink.href = `#comment${this.parentId}`;
|
||||||
replyLink.href = `#comment${this.parentId}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
removeReplyTo() {
|
removeReplyTo() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue