0

On my click event I'm displaying the bootstrap popover, it works but it's being displayed twice. Once on the bottom, like I have defined and once on the bottom right. Code and pics below.

If I set a breakpoint at

return $("#events-popover-head").html();

I can see that this code is being called 4 times!!!

I see that this might be a known bug with twitter bootstrap. I read here that it happens when you don't have a title, but I have both a title and content. I'm using bootstrap 3.3.1 Is there any workaround for this issue?

If I include a dayClick event the day click popover is ok (showing just one)

$('#fullcalendar').fullCalendar({
        header: {
            left: 'prev,next', //today',
            center: 'title',
            //right: 'month,agendaWeek,agendaDay'
            right: ''
        },
        defaultView: 'month',
        editable: true,
        allDaySlot: false,
        selectable: true,
        slotMinutes: 15,
        events: '/ManageSpaces/GetDiaryEvents/',

        eventClick: function (data, event, view) {
            $(this).children().popover({
                html: true,
                placement: 'bottom',
                container: 'body',
                title: function () {
                    return $("#events-popover-head").html();
                },
                content: function () {
                    return $("#events-popover-content").html();
                }
            });
            if ($calPopOver)
                $calPopOver.popover('destroy');
            $calPopOver = $(this).children().popover('show');
        },
  dayClick: function (data, event, view) {
            $(this).children().popover({
                html: true,
                placement: 'bottom',
                container: 'body',
                title: function () {
                    return $("#day-popover-head").html();
                },
                content: function () {
                    return $("#day-popover-content").html();
                }
            });
            if ($calPopOver)
                $calPopOver.popover('destroy');
            $calPopOver = $(this).children().popover('show');
        }
  });

enter image description here

Community
  • 1
  • 1
chuckd
  • 13,460
  • 29
  • 152
  • 331
  • I am not familiar with the fullcalendar plugin, but could it be that the `eventClick` callback is _always_ called when you click somewhere, and the `dayClick` callback only when clicking a day? Meaning: when you click on a day, _both_ will get executed, and as such two popovers will open? – giorgio Mar 31 '15 at 13:26
  • Hi @giorgio, that is not the case as you can check here http://plnkr.co/edit/fApvzb?p=preview – Mario Levrero Mar 31 '15 at 14:50
  • 1
    @user1186050 not that it's required, but I'd feel more inclined to answer this kind of question if there was a jsfiddle reproducing the problem that I could play with. – DanielST Mar 31 '15 at 19:13
  • Hi. I've never used fiddle or set up a fiddle. Maybe I'll take a look, but can't guarantee anything. – chuckd Mar 31 '15 at 23:33

0 Answers0