From 9f86429a1252b45c95b7c62fbaa1b82de3723997 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 05 Jan 2026 18:16:07 +0000
Subject: [PATCH] =Complete TaxonomySelector.js and TaxonomyCreator.js refactor
---
assets/js/concise/UploadManager.js | 26 ++++++++++++++++++++++++--
1 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/assets/js/concise/UploadManager.js b/assets/js/concise/UploadManager.js
index b48d38c..7301390 100644
--- a/assets/js/concise/UploadManager.js
+++ b/assets/js/concise/UploadManager.js
@@ -1279,7 +1279,7 @@
const grid = element.querySelector('.item-grid');
if (grid) {
grid.dataset.groupId = groupId;
- this.createSortableForGrid(fieldId, grid, groupId);
+ this.createSortable(fieldId, grid, groupId);
}
let storedData = this.stores.groups.data.has(groupId)
@@ -1587,7 +1587,25 @@
chosenClass: 'chosen',
dragClass: 'dragging',
- onStart: () => this.syncSortableSelection(fieldId),
+ onStart: (evt) => {
+ // Get the dragged item's ID
+ const draggedItem = evt.item;
+ const uploadId = draggedItem?.dataset.uploadId;
+
+ // Get the selected items Set for this field
+ const selectedItems = this.selected.get(fieldId);
+
+ // If the dragged item isn't selected, select it
+ if (uploadId && (!selectedItems || !selectedItems.has(uploadId))) {
+ const handler = this.selectionHandlers.get(fieldId);
+ if (handler) {
+ handler.select(uploadId);
+ }
+ }
+
+ // Sync all selections to Sortable
+ this.syncSortableSelection(fieldId);
+ },
onEnd: (evt) => this.sortableDrop(evt, fieldId),
});
@@ -1739,6 +1757,10 @@
})
]);
+ if (this.restoreModal) {
+ this.cleanupRestore();
+ }
+
this.a11y.announce('Cache cleared for this page');
}
--
Gitblit v1.10.0