mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 03:20:02 +08:00
13 lines
451 B
TypeScript
13 lines
451 B
TypeScript
/** Tasks travel between the rail, the day row and the grid as this drag type. */
|
|
export const TASK_DRAG_TYPE = 'application/x-deeptutor-task'
|
|
|
|
export function writeTaskDrag(transfer: DataTransfer, id: string) {
|
|
transfer.setData(TASK_DRAG_TYPE, id)
|
|
transfer.setData('text/plain', id)
|
|
transfer.effectAllowed = 'copyMove'
|
|
}
|
|
|
|
export function readTaskDrag(transfer: DataTransfer): string | null {
|
|
return transfer.getData(TASK_DRAG_TYPE) || null
|
|
}
|