bootstrap popover called twice

♀尐吖头ヾ 提交于 2019-12-13 05:04:28

问题


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');
        }
  });

来源:https://stackoverflow.com/questions/29358339/bootstrap-popover-called-twice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!