fix: add missing cancelAbstractPreview function and related state
The openImportWindow and closeImportWindow functions referenced cancelAbstractPreview which was not defined. Added: - hoverTimerId, hoveredItemKey, previewItemKey to state - previewPopover to elements object - cancelAbstractPreview function Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d624315fbf
commit
b955d382e3
@ -492,6 +492,9 @@
|
||||
loadingCollectionKey: null,
|
||||
nextCollectionItemsRequestToken: 0,
|
||||
activeCollectionItemsRequestToken: 0,
|
||||
hoveredItemKey: null,
|
||||
hoverTimerId: null,
|
||||
previewItemKey: null,
|
||||
};
|
||||
|
||||
const elements = {
|
||||
@ -514,6 +517,7 @@
|
||||
windowCollectionStatus: document.getElementById("window-collection-status"),
|
||||
windowCollectionTree: document.getElementById("window-collection-tree"),
|
||||
windowCollectionItems: document.getElementById("window-collection-items"),
|
||||
previewPopover: document.getElementById("item-preview-popover"),
|
||||
currentProjectLabel: document.getElementById("current-project-label"),
|
||||
cardList: document.getElementById("card-list"),
|
||||
cardDetail: document.getElementById("card-detail"),
|
||||
@ -667,6 +671,20 @@
|
||||
persistWindowSessionState();
|
||||
}
|
||||
|
||||
function cancelAbstractPreview() {
|
||||
if (state.hoverTimerId !== null) {
|
||||
window.clearTimeout(state.hoverTimerId);
|
||||
state.hoverTimerId = null;
|
||||
}
|
||||
state.hoveredItemKey = null;
|
||||
state.previewItemKey = null;
|
||||
elements.previewPopover.hidden = true;
|
||||
elements.previewPopover.setAttribute("aria-hidden", "true");
|
||||
elements.previewPopover.textContent = "";
|
||||
elements.previewPopover.style.top = "";
|
||||
elements.previewPopover.style.left = "";
|
||||
}
|
||||
|
||||
function setStatus(target, message, isError = false) {
|
||||
target.textContent = message || "";
|
||||
target.classList.toggle("error", Boolean(isError));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user