-
Notifications
You must be signed in to change notification settings - Fork 727
0.8.1 breaks this in eventClick #105
Comments
good find. This is caused by the directive wrapping all of the calendarConfig functions with a $timeout function, which creates a new execution context that breaks this use case. So the question is could this be an unnecessary regression? Do we really need the calendar to wrap all functions with apply, or could we have the developer do this on their own? If so then then the fix could be do just call either a timeout execution after the fullcalendar function call. http://plnkr.co/edit/FXLmrXMoZRbbFkjkoKQW?p=preview I changed the code to look like this.
Simple change. Their is probably a better way. Maybe someone else knows it and would like to share. |
It also breaks the use of (this) on event drops to the calendar. Further issue, seemingly to do with the added $timeouts is that I also use eventRender function to dynamically change colour of events as they render. Now with the added $timeouts, these events flash on render which is not great. Surely must be a better way, but it's out of my skill range unfortunately! I've reverted to 0.8.0 for the time being. |
Hmm I guess forcing the timeouts was not the best idea.
|
angular-ui#87 angular-ui#105 Signed-off-by: joshkurz <[email protected]>
I think this issue is also stopping 'return false' from preventing the redirect if the event has a url attribute. |
angular-ui#87 angular-ui#105 Signed-off-by: joshkurz <[email protected]>
angular-ui#87 angular-ui#105 Signed-off-by: joshkurz <[email protected]>
@joshkurz I am seeing the same problem with "return false" not preventing the redirect if the event has a url attribute (with fixed code). Does anyone have a workaround to prevent the redirect to the event url? |
@dalyc I have been simply removing url with eventDataTransform(). If you still want to trigger the event, save it as a different field name and open it in eventClick() |
@mattcasey Thanks Matt. That works. |
According to the FullCalendar documentation for eventClick:
This is also true in the 0.8.0 version of ui-calendar, but 0.8.1 broke the way
this
works in eventClick.The example callback from the FullCalendar documentation uses jQuery to set the border color of the event to red. This works fine in ui-calendar 0.8.0, but not in 0.8.1.
Here is a plunker where you can switch between both versions to see the issue:
http://plnkr.co/edit/DKDD7vAlV2ZrQ3fCD8uS?p=preview
The text was updated successfully, but these errors were encountered: