(sourceId: string, targetId: string, newArea = false)
| 25 | }; |
| 26 | |
| 27 | const moveCardItem = (sourceId: string, targetId: string, newArea = false) => { |
| 28 | if (sourceId === targetId) return; |
| 29 | if (sourceId) { |
| 30 | const checkIndex = getIndexById("", sourceId); |
| 31 | let newIndex = getIndexById("", targetId); |
| 32 | if (checkIndex != -1) { |
| 33 | // Move from layout pool |
| 34 | const item = deleteLayoutItem("", sourceId); |
| 35 | if (!item) return; |
| 36 | if (!newArea) { |
| 37 | insertLayoutItem("", item, newIndex); |
| 38 | } else { |
| 39 | if (checkIndex > newIndex) newIndex += 1; |
| 40 | insertLayoutItem("", item, newIndex); |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | }; |
| 45 | |
| 46 | const dragover = (e: DragEvent, id: string) => { |
| 47 | if (!containerState.isDesignMode) return; |
no test coverage detected