Permalink
Browse files

Bugs

  • Loading branch information...
cgst committed Mar 12, 2011
1 parent e3f48c2 commit d789526491c36f27c8eaf49d8383cde28d52dab7
Showing with 13 additions and 7 deletions.
  1. +13 −7 popover.js
View
@@ -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;
@@ -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;
});
});

0 comments on commit d789526

Please sign in to comment.