Permalink
Browse files

Set display: none to a hidden popover so we can never tab into it.

  • Loading branch information...
cgst committed Mar 11, 2011
1 parent a5563f0 commit e3f48c230eac7999837a88d501ef1f6cac8b0492
Showing with 6 additions and 4 deletions.
  1. +6 −4 popover.js
View
@@ -38,6 +38,9 @@ $.fn.popover = function(options) {
var triangle = $('.triangle', floater).click(function() {
button.trigger('hidePopover') });
+ // Set this first for the layout calculations to work.
+ floater.css('display', 'block');
+
// position and resize
var leftOff = 0;
var topOff = 0;
@@ -59,7 +62,7 @@ $.fn.popover = function(options) {
}
// Padding against document borders
- var padding = 18;
+ var padding = 18;
// Calculate leftOff
leftOff = offset.left + (buttonWidth - contentWidth)/2;
@@ -71,7 +74,7 @@ $.fn.popover = function(options) {
// left of the screen right
diffWidth = leftOff + contentWidth - docWidth + padding;
}
-
+
// position triangle
triangle.css("left", contentWidth/2 - triangleSize + diffWidth);
@@ -99,8 +102,7 @@ $.fn.popover = function(options) {
button.bind('showPopover', function() { showPopover(button) });
button.bind('hidePopover', function() {
button.removeClass('popover-on');
- floater.removeClass("active");
- floater.attr("style", "");
+ floater.removeClass("active").attr("style", "").css('display', 'none');
if ($.isFunction(options.closeEvent)) options.closeEvent();
$.fn.popover.openedPopup = null;
return false;

0 comments on commit e3f48c2

Please sign in to comment.