MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / handleFileClick

Function handleFileClick

renderer.js:13336–13456  ·  view source on GitHub ↗
(event, filePath)

Source from the content-addressed store, hash-verified

13334}
13335
13336function isInSelectedModels(filePath) {
13337 const normalized = normalizePathForComparison(filePath);
13338 for (const path of selectedModels) {
13339 if (normalizePathForComparison(path) === normalized) {
13340 return true;
13341 }
13342 }
13343 return false;
13344}
13345
13346/** Match search.js: full-library progressive load returns partial rows — do not clear selection in that case. */
13347function shouldSyncSelectionWithFilteredList() {
13348 const designer = document.getElementById('designer-select')?.value || '';
13349 const license = document.getElementById('license-select')?.value || '';
13350 const parentModel = document.getElementById('parent-select')?.value || '';
13351 const printStatus = document.getElementById('printed-select')?.value || 'all';
13352 const newStatus = document.getElementById('new-select')?.value || 'all';
13353 const tagFilter = document.getElementById('tag-filter')?.value || '';
13354 const fileType = document.getElementById('filetype-select')?.value || '';
13355 const searchTerm = (document.getElementById('search-filter-input')?.value || '').trim();
13356 const qbClauses =
13357 typeof window.queryBuilderHasActiveSearchClauses === 'function' &&
13358 window.queryBuilderHasActiveSearchClauses();
13359 const qbMulti =
13360 typeof window.queryBuilderHasActiveMultiFilters === 'function' &&
13361 window.queryBuilderHasActiveMultiFilters();
13362 const noFiltersActive = !designer && !license && !parentModel && printStatus === 'all' &&
13363 newStatus === 'all' &&
13364 !tagFilter && !fileType && !searchTerm && !qbClauses && !qbMulti &&
13365 !window.currentDirectoryFilter && !window.dateAddedFilter;
13366 const useProgressiveFullLibrary = noFiltersActive;
13367 return !useProgressiveFullLibrary;
13368}
13369
13370function clearModelDetailsSidebar() {
13371 currentModelDetailsPath = null;
13372 currentModelDetailsAbort = true;
13373 const pathTreeContainer = document.getElementById('path-tree-container');
13374 if (pathTreeContainer) {
13375 pathTreeContainer.innerHTML = '';
13376 pathTreeContainer.removeAttribute('data-file-path');
13377 }
13378 const mn = document.getElementById('model-name');
13379 if (mn) mn.value = '';
13380 const md = document.getElementById('model-designer');
13381 if (md) md.value = '';
13382 const ms = document.getElementById('model-source');
13383 if (ms) ms.value = '';
13384 const mnotes = document.getElementById('model-notes');
13385 if (mnotes) mnotes.value = '';
13386 const mp = document.getElementById('model-printed');
13387 if (mp) mp.checked = false;
13388 const mparent = document.getElementById('model-parent');
13389 if (mparent) mparent.value = '';
13390 const mlic = document.getElementById('model-license');
13391 if (mlic) mlic.value = '';
13392 const mtags = document.getElementById('model-tags');
13393 if (mtags) mtags.innerHTML = '';

Callers 2

createModelItemFunction · 0.85

Calls 13

populateTagSelectFunction · 0.85
addToSelectedModelsFunction · 0.85
isInSelectedModelsFunction · 0.85
removeFromSelectedModelsFunction · 0.85
updateSelectedCountFunction · 0.85
showMultiEditPanelFunction · 0.85
exitMultiEditModeFunction · 0.85

Tested by

no test coverage detected