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.
This commit is contained in:
parent
41d544be7e
commit
41a5d0ba5e
1 changed files with 0 additions and 11 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue