LearnNewsExamplesServices
Frontmatter
id1504
titledraggable.DragZone: onAfterDragStart()
stateClosed
labels
enhancementhelp wantedgood first issuestale
assignees[]
createdAtFeb 2, 2021, 1:59 PM
updatedAtSep 19, 2024, 4:30 AM
githubUrlhttps://github.com/neomjs/neo/issues/1504
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtSep 19, 2024, 4:30 AM

draggable.DragZone: onAfterDragStart()

Closed v8.1.0 enhancementhelp wantedgood first issuestale
tobiu
tobiu commented on Feb 2, 2021, 1:59 PM

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 added the enhancement label on Feb 2, 2021, 1:59 PM
tobiu added the help wanted label on Feb 2, 2021, 1:59 PM
tobiu added the good first issue label on Feb 2, 2021, 1:59 PM