Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fullcalendar with Twitter Bootstrap Popover

I am trying to get Fullcalendar working with twitter boostrap popovers.
if I click an event, i want to show some details in the popover.
So first added this lil snippet to Fullcalendar:

eventClick: function(event, jsEvent, view) {
        $this = $(this);
        $this.popover({html:true,title:event.title,placement:'top'}).popover('show');
        return false;            
    },

But now I run into 2 problems:

  1. Fullcalendar is inside a div that has overflow:hidden or something, because the popover gets cut on the border of Fullcalendar. How do I fix that?
  2. Similar to problem 2 I would like to place the popover via a function on top, left, right or bottom depending on the position where the event is in the Fullcalendar grid. How can i do such a function?

thanks!

like image 966
Merion Avatar asked Jan 04 '13 13:01

Merion


2 Answers

From version 2.3 bootstrap now has a "container" option for popovers which appends the popover to a specific element.

just add {container:'body'} to append it to the body

$this.popover({html:true,title:event.title,placement:'top',container:'body'}).popover('show');
like image 84
clemnt Avatar answered Sep 24 '22 22:09

clemnt


This code helped me

$('#calendar').fullCalendar({
    eventRender: function (event, element) {
        element.popover({
            title: event.name,
            placement: 'right',
            content: + '<br />Start: ' + event.starts_at + '<br />End: ' + event.ends_at + '<br />Description: ' + event.description,
        });
    }
});

bootstrap version - 2.3.2, full calendar - 1.6.4

taken from https://groups.google.com/forum/#!topic/twitter-bootstrap-stackoverflow/9pkC3_lodmY

like image 42
dav Avatar answered Sep 23 '22 22:09

dav