bootstrap-year-calendar
bootstrap-year-calendar copied to clipboard
Close the day element when clicking anywhere
Hi,
I have modified the code so that the event info will be shown just after we clicked the specific day. I changed the mouseOnDay
to clickDay
and set the popover to show. This is the code:
clickDay: function(e) {
if(e.events.length > 0) {
var content = '';
for(var i in e.events) {
content += '<div class="event-tooltip-content">'
+ '<div class="event-name" style="color:' + e.events[i].color + '; white-space:nowrap;">' + e.events[i].name + '</div>'
+ '<div class="event-location">' + e.events[i].location + '</div>'
+ '</div>';
}
$(e.element).popover({
trigger: 'manual',
container: 'body',
html:true,
content: content,
placement: 'auto'
});
$(e.element).popover('show');
}
}
I would love to close the info when we click anywhere. mouseOutDay
is not quite the right fit for this case. Is there anyway to achieve this?