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

Function getSharedRenderer

renderer.js:12792–12834  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12790 if (tagSelect && tagSelect.value) {
12791 await autoSaveMultipleModels('tags', tagSelect.value);
12792 tagSelect.value = ''; // Reset selection
12793 }
12794 });
12795 }
12796
12797 // Debug log for initialization
12798 debugLog('Multi-edit panel initialization complete');
12799
12800 } catch (error) {
12801 console.error('Error during application initialization:', error);
12802 }
12803 });
12804
12805 // ... existing code ...
12806});
12807
12808async function updateSelectedCount() {
12809 const countElement = document.querySelector('.selected-count');
12810 if (countElement) {
12811 countElement.textContent = `${selectedModels.size} model${selectedModels.size !== 1 ? 's' : ''} selected`;
12812 }
12813
12814 // Clear tags when selection changes significantly (new group of files selected)
12815 clearTagsOnSelectionChange();
12816
12817 // Clear multi-edit form fields when no models are selected
12818 if (selectedModels.size === 0 && isMultiSelectMode) {
12819 clearMultiEditFormFields();
12820 }
12821
12822 // Refresh the remove tag dropdown when selection changes (if in multi-edit mode)
12823 if (isMultiSelectMode && selectedModels.size > 0) {
12824 await populateRemoveTagSelect();
12825 }
12826}
12827
12828// Track previous selection to detect when a completely new selection is made
12829let previousSelectionHash = '';
12830
12831function clearTagsOnSelectionChange() {
12832 // Create a hash of current selection to detect complete selection changes
12833 const currentSelectionHash = selectedModels.size > 0
12834 ? Array.from(selectedModels).sort().join('|')
12835 : '';
12836
12837 // If selection was cleared (went from >0 to 0), mark for clearing on next selection

Callers 2

renderSTLThumbnailFunction · 0.85
renderModelToPNGFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected