+ refEl.append(markerWrap);
+ }
+
+ protected showCommentAtMarker(marker: HTMLElement): void {
+
+ marker.hidden = true;
+ const readClone = this.container.closest('.comment-branch').cloneNode(true) as HTMLElement;
+ const toRemove = readClone.querySelectorAll('.actions, form');
+ for (const el of toRemove) {
+ el.remove();
+ }
+
+ const close = el('button', {type: 'button'}, ['x']);
+ const jump = el('button', {type: 'button'}, ['Jump to thread']);
+
+ const commentWindow = el('div', {
+ class: 'content-comment-window'
+ }, [
+ el('div', {
+ class: 'content-comment-window-actions',
+ }, [jump, close]),
+ el('div', {
+ class: 'content-comment-window-content',
+ }, [readClone]),
+ ]);
+
+ marker.parentElement.append(commentWindow);
+
+ const closeAction = () => {
+ commentWindow.remove();
+ marker.hidden = false;
+ };
+
+ close.addEventListener('click', closeAction.bind(this));
+
+ jump.addEventListener('click', () => {
+ closeAction();
+ this.container.scrollIntoView({behavior: 'smooth'});
+ const highlightTarget = this.container.querySelector('.header') as HTMLElement;
+ highlightTarget.classList.add('anim-highlight');
+ highlightTarget.addEventListener('animationend', () => highlightTarget.classList.remove('anim-highlight'))
+ });
+
+ // TODO - Position wrapper sensibly
+ // TODO - Movement control?