Saturday, 28 September 2013

How to close previous popovers in fullCalendar?

How to close previous popovers in fullCalendar?

I am using fullCalendar in my website together with Bootstrap so that
everytime I click on a day in month view, there is a popover to add event,
just like that in Google Calendar. Here is my code
$(document).ready(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
var calendar = $('#calendar').fullCalendar({
height: height,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
dayClick: function( date, allDay, jsEvent, view ){
$(this).children().popover({
title: 'haha',
placement: 'right',
content: 'haha',html : true, container: 'body'
});
$(this).children().popover('show');
}
})
The code should be right before $(this).children().popover({ so that it
closes all previously fired popover.
However, exactly, what code should I use to achieve this?
Thank you!

No comments:

Post a Comment