this.closeText = this.$opts.closeText;
// Show within page display area if seen
- const pageContentArea = document.querySelector('.page-content');
- if (pageContentArea instanceof HTMLElement && this.link.checkVisibility()) {
- this.updateMarker(pageContentArea);
- }
+ this.showForDisplay();
// Handle editor view to show on comments toolbox view
window.addEventListener('editor-toolbox-change', (event) => {
// Handle comments tab changes to hide/show markers & indicators
window.addEventListener('tabs-change', event => {
const sectionId = (event as {detail: {showing: string}}).detail.showing;
- if (!sectionId.startsWith('comment-tab-panel') || !(pageContentArea instanceof HTMLElement)) {
+ if (!sectionId.startsWith('comment-tab-panel')) {
return;
}
const panel = document.getElementById(sectionId);
if (panel?.contains(this.link)) {
- this.updateMarker(pageContentArea);
+ this.showForDisplay();
} else {
this.hideMarker();
}
});
}
+ public showForDisplay() {
+ const pageContentArea = document.querySelector('.page-content');
+ if (pageContentArea instanceof HTMLElement && this.link.checkVisibility()) {
+ this.updateMarker(pageContentArea);
+ }
+ }
+
protected showForEditor() {
const contentWrap = document.querySelector('.editor-content-wrap');
if (contentWrap instanceof HTMLElement) {
return;
}
- const refCloneToAssess = refEl.cloneNode(true) as HTMLElement;
- const toRemove = refCloneToAssess.querySelectorAll('[data-lexical-text]');
- refCloneToAssess.removeAttribute('style');
- for (const el of toRemove) {
- el.after(...el.childNodes);
- el.remove();
- }
-
- const actualHash = hashElement(refCloneToAssess);
+ const actualHash = hashElement(refEl);
if (actualHash !== refHash) {
this.link.classList.add('outdated');
}