From 41a5d0ba5eae3df07d33c231b400bd12732f2418 Mon Sep 17 00:00:00 2001 From: Kumi Date: Wed, 31 Jul 2024 08:55:55 +0200 Subject: [PATCH] refactor: consolidate task move event handling Removed redundant emitTaskMovedEvent function to streamline task event emissions. Now emitting a generalized 'taskChanged' event for task movements, ensuring consistent event handling and reducing code duplication. --- kanblendar.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/kanblendar.js b/kanblendar.js index c965c58..d207c6f 100644 --- a/kanblendar.js +++ b/kanblendar.js @@ -249,7 +249,6 @@ class Kanblendar { if (dropTarget.classList.contains('kanblendar-time-slot') || dropTarget.classList.contains('kanblendar-non-timed-tasks')) { dropTarget.appendChild(task); - this.emitTaskMovedEvent(task, dropTarget); this.emitTaskChangedEvent('move', task); } @@ -441,16 +440,6 @@ class Kanblendar { } } - emitTaskMovedEvent(task, target) { - const event = new CustomEvent('taskMoved', { - detail: { - taskId: task.id, - newParent: target.id - } - }); - document.dispatchEvent(event); - } - adjustTimeSlotHeights() { const timeSlotMap = new Map(); let maxNonTimedHeight = 0;