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

Comments: Addressed a range of edge cases and ux issues for references

Handles only display and handling references when they're in the active
tab, while handling proper removal when made not visible.
This commit is contained in:
Dan Brown
2025-05-01 16:33:42 +01:00
parent e7dcc2dcdf
commit 15c79c38db
3 changed files with 37 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
import {Component} from './component';
import {getLoading, htmlToDom} from '../services/dom.ts';
import {buildForInput} from '../wysiwyg-tinymce/config';
import {PageCommentReference} from "./page-comment-reference";
export class PageComment extends Component {
@@ -142,7 +143,13 @@ export class PageComment extends Component {
const response = await window.$http.put(`/comment/${this.commentId}/${action}`);
window.$events.success(this.archiveText);
this.$emit(action, {new_thread_dom: htmlToDom(response.data as string)});
this.container.closest('.comment-branch')?.remove();
const branch = this.container.closest('.comment-branch') as HTMLElement;
const references = window.$components.allWithinElement<PageCommentReference>(branch, 'page-comment-reference');
for (const reference of references) {
reference.hideMarker();
}
branch.remove();
}
protected showLoading(): HTMLElement {