简体   繁体   English

Angular-UI日历​​中的Bootstrap 3 Popover

[英]Bootstrap 3 Popover in Angular-UI Calendar

I'm using Angular-UI Calendar directive and Bootstrap 3 popover to attempt to create a popover on click. 我正在使用Angular-UI Calendar指令和Bootstrap 3 popover尝试在单击时创建一个popover。 I tried using the day click event: 我尝试使用Day Click事件:

 $scope.dayClick = function(event, allDay, jsEvent, view){
    jsEvent.stopPropagation();
    jsEvent.preventDefault();
    var eventID = event.getDate();
    eventID = jsEvent.target; 
    $(eventID).popover({
      html: true,
      title: 'Hello',
      placement: 'bottom',
      content: '<button id="close-me">Close Me!</button>'
    }).parent().delegate('button#close-me', 'click', function() {
      jsEvent.stopPropagation();
      $(eventID).popover('hide');
      return false;
    });

    $(eventID).popover('show');
  };

The problem with this way is that it causes the calendar cells to push to the right at times or duplicate. 这种方法的问题在于,它导致日历单元有时会向右推或重复。 Is there a better way I could attach the popover to the existing calendar? 有没有一种更好的方法可以将弹出框附加到现有日历上?

Are you trying to create pop-over when any day is clicked? 您是否想在单击任意一天时创建弹出窗口? If yes, then dayClick is the correct way for a popover. 如果是,则dayClick是弹出窗口的正确方法。

Can you create a Plunk to provide more details. 您可以创建一个Plunk来提供更多详细信息吗?

I think the problem may be due to CSS. 我认为问题可能是由于CSS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM