Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Prevent events from disappearing with optional sticky events #244

Merged
merged 1 commit into from
Apr 25, 2015

Conversation

laander
Copy link
Contributor

@laander laander commented Mar 25, 2015

Simple, non-intrusive, fix for the common disappearing events problem (here #234 & #163 & #99 & #51). It simply allows the events to become sticky (3rd argument on renderEvent) if a property event.stick is set to true. This means that events will persistent across view changes.

@laander
Copy link
Contributor Author

laander commented Mar 25, 2015

In practise, the property can be set on events whenever they are created, like so:

$scope.eventSources.push([{
  title: "Foo",
  start: // Moment time object
  end: // Moment time object
  stick: true
}])

I use it together with the select callback option on uiConfig to create temporary events by painting on the calendar canvas.

@joshkurz
Copy link
Contributor

joshkurz commented Apr 4, 2015

This looks a good solution, but I still don't like the fact that we have to use the stick parameter at all. It seems odd to me. I guess an event that is added after the calendar is loaded should have stick and others should not? Is that your usual workflow? When do you add stick and when don't you?

@laander
Copy link
Contributor Author

laander commented Apr 8, 2015

Yes, i only use it when working with dynamic event sources where users can add/delete events after load. I've found no other way to fix the problem in that use case, and IMO, that's the only scenario where stick should be used. Do you have any other suggestions for a fix without stick?

@jkurz
Copy link
Contributor

jkurz commented Apr 8, 2015

no this is the best one I have seen. Its simple, which is why I like it. I'll test it out and make sure its good. If all is well. I'll merge this in.

@laander
Copy link
Contributor Author

laander commented Apr 9, 2015

Swell, let me know if you need any more from me 👍

joshkurz added a commit that referenced this pull request Apr 25, 2015
Prevent events from disappearing with optional sticky events
@joshkurz joshkurz merged commit f85a914 into angular-ui:master Apr 25, 2015
@joshkurz
Copy link
Contributor

thanks @laander

@laander
Copy link
Contributor Author

laander commented Apr 26, 2015

Glad to see this happen, thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants