jquery.schedule icon indicating copy to clipboard operation
jquery.schedule copied to clipboard

Wrong timeline value when 2 items stacked in same timeline

Open JavierTous opened this issue 4 years ago • 1 comments

You can check this problem on the demo too.

If you click (without draggin), the second item (stacked) on the first timeline. The return from the on Click is:

{"start":"11:00","end":"14:00","text":"Text Area","timeline":"1","data":{},"startTime":39600,"endTime":50400}

note that timeline value is 1, should be 0. Same happens when you resize the element.

If you move the element, timeline is recalculated and it works. I think on the initial load of data, something is wrong.

JavierTous avatar Apr 16 '21 15:04 JavierTous

I may have fixed it by changing in line 668 data.timeline = i; to data.timeline = timeline

so the scheduledata gets the timeline from the current row instead of the index of schedules in the row. I don't know if this was intentional. Hopefully somebody can check and it's helpful.

Edit:: Incidentally, this solves another small issue. If you drag a stacked item to another timeline, the row doesnt's resize. Happens in the demo too. By changing this, size of row gets recalculated.

JavierTous avatar Apr 16 '21 15:04 JavierTous