karoun/jQuery-Popover-Plugin — Issue #2: onClose is called for every instance, not just the one i'm working with
Author: ragulka
Created: 2012-02-17 06:52:38+00:00
State: open

I'm trying to use:

$(".popover-control").popover({
'position' : 'bottom',
'closeHTML' : '',
'content' : function() { return $('#content').html() },
'onClose' : function() { $(this.settings.attachTo).focus() }
})

However, it sets the focus to the last popover control, bot the one i'm working with. This happens because "onClose" is called for every popover instance, and the onClose function is passed to every popover instance. So, if I have 3 popovers on my page, the function gets called 3 x 2 = 6 times!

I understand that hidePopover should loop over all popovers to ensure all of them close, but there should be a way to fiddle with the original attachTo element.