Skip to content
This repository has been archived by the owner. It is now read-only.

Get the day from where the event drag started #250

Closed
badreal opened this Issue Dec 31, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@badreal
Copy link

badreal commented Dec 31, 2015

Is it possible to get the day from where the event drag started in month controller. I noticed that it has no drag events , and HandleDropEvent triggers onEventTimesChanged event to which the event and new date are passed but not the day from where the drag started.

@mattlewis92

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Jan 1, 2016

on-event-times-changed doesn't actually do anything to the original event, so just use calendarEvent.startsAt to get the original start date.

@mattlewis92 mattlewis92 closed this Jan 1, 2016

@badreal

This comment has been minimized.

Copy link
Author

badreal commented Jan 1, 2016

I was actually talking about the date from where the drag started in case the event is taking more than one day. I figured out that MwlDraggable controller has access to global scope so i was able to add a startdragdate property to the "vm" from interact function.

interact($element[0]).draggable({
      snap: snap,
      onstart: function (event) {
        if (canDrag()) {
          angular.element(event.target).addClass('dragging-active');
          event.target.dropData = $parse($attrs.dropData)($scope);
          event.target.style.pointerEvents = 'none';
            //used to get the date from where the drag started
          if (event.isInCalendar == true)
                        $scope.vm.startDragDate = $scope.day.date;
             .....

Anyway, thanks for your help.

mattlewis92 pushed a commit that referenced this issue Jan 1, 2016

@mattlewis92

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Jan 1, 2016

Ah right, that makes sense, it's implemented now in master and I'll cut a new release once the new docs are finished in the next few days.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.