neo icon indicating copy to clipboard operation
neo copied to clipboard

draggable.DragZone: onAfterDragStart()

Open tobiu opened this issue 4 years ago • 0 comments

Flagging this issue as "good first issue" & "help wanted", since it is an easy one.

Move the logic inside the promise callback of dragStart() into a new method.

        Neo.main.DomAccess.getBoundingClientRect({
            id: me.getDragElementRoot().id
        }).then(rect => {
            offsetX = data.clientX - rect.left;
            offsetY = data.clientY - rect.top;

            Object.assign(me, {
                dragElementRect: rect,
                offsetX        : offsetX,
                offsetY        : offsetY
            });

            me.createDragProxy(rect);

            me.fire('dragStart', {
                dragElementRect: rect,
                id             : me.id,
                offsetX        : offsetX,
                offsetY        : offsetY
            });
        });

draggable.calendar.WeekEventDragZone can then use it to fire the dragStart event.

tobiu avatar Feb 02 '21 12:02 tobiu