1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-06 12:02:45 +03:00

Comments: Started archive display, created mode for tree node

This commit is contained in:
Dan Brown
2025-04-28 20:09:18 +01:00
parent 8bdf948743
commit 099f6104d0
10 changed files with 110 additions and 28 deletions

View File

@@ -137,10 +137,12 @@ export class PageComment extends Component {
protected async archive(): Promise<void> {
this.showLoading();
const isArchived = this.archiveButton.dataset.isArchived === 'true';
const action = isArchived ? 'unarchive' : 'archive';
await window.$http.put(`/comment/${this.commentId}/${isArchived ? 'unarchive' : 'archive'}`);
this.$emit('archive');
const response = await window.$http.put(`/comment/${this.commentId}/${action}`);
this.$emit(action, {new_thread_dom: htmlToDom(response.data as string)});
window.$events.success(this.archiveText);
this.container.closest('.comment-branch')?.remove();
}
protected showLoading(): HTMLElement {