Skip to content

Commit

Permalink
Bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgst committed Mar 12, 2011
1 parent e3f48c2 commit d789526
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions popover.js
Expand Up @@ -78,18 +78,18 @@ $.fn.popover = function(options) {
// position triangle
triangle.css("left", contentWidth/2 - triangleSize + diffWidth);

// resize the floater for overflow
floater.children(".content").css("max-height", floater.height()
- parseInt(floater.children(".header").css("height")) - 7);

floater.offset({
top: topOff,
left: leftOff - diffWidth
});
floater.show();
//Timeout for webkit transitions to take effect
window.setTimeout(function(){ floater.addClass("active"); }, 0)
if($.isFunction(options.openEvent)) options.openEvent();
window.setTimeout(function() {
floater.addClass("active");
// Fixes some browser bugs
$(window).resize();
}, 0);
if ($.isFunction(options.openEvent)) options.openEvent();
$.fn.popover.openedPopup = button;
button.addClass('popover-on');
return false;
Expand All @@ -103,8 +103,14 @@ $.fn.popover = function(options) {
button.bind('hidePopover', function() {
button.removeClass('popover-on');
floater.removeClass("active").attr("style", "").css('display', 'none');
if ($.isFunction(options.closeEvent)) options.closeEvent();
if ($.isFunction(options.closeEvent)) {
options.closeEvent();
}
$.fn.popover.openedPopup = null;
window.setTimeout(function() {
// Fixes some browser bugs
$(window).resize();
}, 0);
return false;
});
});
Expand Down

0 comments on commit d789526

Please sign in to comment.