Cancel callback before viewing calendar

I added a bootstrap popovers to the calendar events that open when clicked:

eventClick: (event, jsEvent, view) ->
  if event.ajaxUrl?
    elem = jQuery(@)
    elem.popover('destroy')

    jQuery.ajax({url: event.ajaxUrl})
    .done (result) ->
      elem.popover(
        placement: 'top'
        html: true
        trigger: 'manual'
        title: moment(event.start).format('dddd, DD. MMMM YYYY - HH:mm')
        content: result
        container: 'body')

      elem.popover('show')

My problem is that these popovers remain open when I change the calendar view (for example, change the month or the layout of the week / day). Since popovers are bound to .fc-eventdivs / spanans in the calendar, I need to access these DOM elements to run .popover('destroy').

Whenever the fullCalendar view changes, the old DOM-Elements are replaced with new ones for the new view, so I will need to access them before the view actually changes. Unfortunately, there are only callbacks for loading events ( loadingthat happen after the view changes) and viewDisplay(the same thing, but you get a new view).

viewDisplay, , "0" ( jquery)

viewDisplay: (view) ->
    alert(jQuery('.fc-event:data(popover)').size())

, - , ?

Edit

popovers ( click ),

jQuery('.fc-button').on 'mouseover', () ->
    jQuery('.fc-event:data(popover)').popover('destroy')
+5
2

, http://fullcalendar.io/docs/display/viewRender/

viewRender

, , . (, ) View . element - jQuery .

, - .

, , , (. : eventAfterAllRender).

+3

V4 viewRender , , :

"viewSkeletonRender", , , .

"viewSkeletonDestroy", , .

-

, , , . ( ). "dateRender", , .

0

All Articles