feat: add SortableJS and wrap kanban initialization in a robustness handler for delayed script loading
This commit is contained in:
@@ -15,6 +15,9 @@
|
|||||||
<!-- Tailwind CSS -->
|
<!-- Tailwind CSS -->
|
||||||
<script src="https://cdn.tailwindcss.com"></script>
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
|
|
||||||
|
<!-- Sortable JS for Drag and Drop -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.0/Sortable.min.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
tailwind.config = {
|
tailwind.config = {
|
||||||
darkMode: 'class',
|
darkMode: 'class',
|
||||||
@@ -860,6 +863,12 @@ gantt
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sortable.js Drag and Drop Setup for 4 Kanban Columns
|
// Sortable.js Drag and Drop Setup for 4 Kanban Columns
|
||||||
|
function initKanbanSortable() {
|
||||||
|
if (typeof Sortable === 'undefined') {
|
||||||
|
setTimeout(initKanbanSortable, 100);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
document.querySelectorAll('.kanban-drop-zone').forEach(zone => {
|
document.querySelectorAll('.kanban-drop-zone').forEach(zone => {
|
||||||
new Sortable(zone, {
|
new Sortable(zone, {
|
||||||
group: 'kanban-board',
|
group: 'kanban-board',
|
||||||
@@ -906,6 +915,13 @@ gantt
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.readyState === 'loading') {
|
||||||
|
document.addEventListener('DOMContentLoaded', initKanbanSortable);
|
||||||
|
} else {
|
||||||
|
initKanbanSortable();
|
||||||
|
}
|
||||||
|
|
||||||
// AJAX Module Status Toggle Handler
|
// AJAX Module Status Toggle Handler
|
||||||
function setModuleStatusAjax(moduleId, status) {
|
function setModuleStatusAjax(moduleId, status) {
|
||||||
|
|||||||
Reference in New Issue
Block a user