How can I hide popover element when I start dragging event in fullcalendar and after stop dragging show popover again?
I have this code:
eventRender: function(event, elementos, resource, view) {
var start = $.fullCalendar.formatDate(event.start, "DD-MM-Y HH:mm");
var end = $.fullCalendar.formatDate(event.end, "DD-MM-Y HH:mm");
elementos.popover({
title: start + ' — ' + end,
content: event.title,
trigger: 'hover',
placement: 'top',
container: 'body'
});
}
And when I want to resize or dragging event this happend:
Thank you!
You should use eventAfterRender
instead of eventRender
function to achieve the desired result. So your code will look like this:
eventAfterRender: function(event, elementos, resource, view) {
// code goes here
}
This works because eventRender
is constantly called while dragging because the event is constantly being "snapped" into a cell (in non-month views) and hence ends up creating all the popovers, while eventAfterRender
is triggered after an event has been placed on the calendar in its final position.
You can see it in action here in this codepen
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With