Fix recurrent event splitting being broken after prior refactoring.
This commit is contained in:
@@ -206,6 +206,7 @@ function handleEventPointerDown(span, event) {
|
||||
anchorDate,
|
||||
startDate: span.startDate,
|
||||
endDate: span.endDate,
|
||||
n: span.n,
|
||||
},
|
||||
event,
|
||||
)
|
||||
@@ -224,6 +225,7 @@ function handleResizePointerDown(span, mode, event) {
|
||||
anchorDate: null,
|
||||
startDate: span.startDate,
|
||||
endDate: span.endDate,
|
||||
n: span.n,
|
||||
},
|
||||
event,
|
||||
)
|
||||
@@ -323,7 +325,7 @@ function onDragPointerMove(e) {
|
||||
if (st.mode === 'move') {
|
||||
if (st.n && st.n > 0) {
|
||||
if (!st.realizedId) {
|
||||
const newId = store.splitMoveVirtualOccurrence(st.id, st.startDate, ns, ne)
|
||||
const newId = store.splitMoveVirtualOccurrence(st.id, st.startDate, ns, ne, st.n)
|
||||
if (newId) {
|
||||
st.realizedId = newId
|
||||
st.id = newId
|
||||
@@ -355,7 +357,13 @@ function onDragPointerMove(e) {
|
||||
if (!st.realizedId) {
|
||||
const initialStart = ns
|
||||
const initialEnd = ne
|
||||
const newId = store.splitMoveVirtualOccurrence(st.id, st.startDate, initialStart, initialEnd)
|
||||
const newId = store.splitMoveVirtualOccurrence(
|
||||
st.id,
|
||||
st.startDate,
|
||||
initialStart,
|
||||
initialEnd,
|
||||
st.n,
|
||||
)
|
||||
if (newId) {
|
||||
st.realizedId = newId
|
||||
st.id = newId
|
||||
@@ -438,7 +446,7 @@ function applyRangeDuringDrag(st, startDate, endDate) {
|
||||
if (st.n && st.n > 0) {
|
||||
if (st.mode !== 'move') return // no resize for virtual occurrence
|
||||
// Split-move: occurrence being dragged treated as first of new series
|
||||
store.splitMoveVirtualOccurrence(st.id, st.startDate, startDate, endDate)
|
||||
store.splitMoveVirtualOccurrence(st.id, st.startDate, startDate, endDate, st.n)
|
||||
return
|
||||
}
|
||||
store.setEventRange(st.id, startDate, endDate, { mode: st.mode })
|
||||
|
||||
Reference in New Issue
Block a user