mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Comments: Fixed display, added archive list support for editor toolbox
This commit is contained in:
@ -34,13 +34,26 @@ export class PageCommentReference extends Component {
|
||||
window.addEventListener('editor-toolbox-change', (event) => {
|
||||
const tabName: string = (event as {detail: {tab: string, open: boolean}}).detail.tab;
|
||||
const isOpen = (event as {detail: {tab: string, open: boolean}}).detail.open;
|
||||
if (tabName === 'comments' && isOpen) {
|
||||
if (tabName === 'comments' && isOpen && this.link.checkVisibility()) {
|
||||
this.showForEditor();
|
||||
} else {
|
||||
this.hideMarker();
|
||||
}
|
||||
});
|
||||
|
||||
// Handle visibility changes within editor toolbox archived details dropdown
|
||||
window.addEventListener('toggle', event => {
|
||||
if (event.target instanceof HTMLElement && event.target.contains(this.link)) {
|
||||
window.requestAnimationFrame(() => {
|
||||
if (this.link.checkVisibility()) {
|
||||
this.showForEditor();
|
||||
} else {
|
||||
this.hideMarker();
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {capture: true});
|
||||
|
||||
// Handle comments tab changes to hide/show markers & indicators
|
||||
window.addEventListener('tabs-change', event => {
|
||||
const sectionId = (event as {detail: {showing: string}}).detail.showing;
|
||||
|
Reference in New Issue
Block a user