Ok, that explains why.
So, now I do this:
$("<selector>").filter(function() {
return $(this).data('popover') != null;
}).popover('hide').removeData('popover');
But it feels like a hack (because it is). Can't there be a better way?
For those wondering, I'm using popovers for form input errors, so I need to
clear them when the form is resubmitted. Plus the content must be dynamic.
On Thursday, June 28, 2012 9:23:00 PM UTC-5, greatghoul wrote:
>
>
>
> $.fn.popover = function (option) {
>
>
>
> return this.each(function () {
>
>
>
> var $this = $(this)
>
>
>
> , data = $this.data('popover')
>
>
>
> , options = typeof option == 'object' && option
>
>
>
> *if (!data) $this.data('popover', (data = new Popover(this, options)))*
>
>
>
> if (typeof option == 'string') data[option]()
>
>
>
> })
>
>
>
> }
>
>
> When you call popover with an object option { trigger: 'manual' , /* more
> stuff */} , the popover's will not create its instance again if (!data) *{
> /* this will not work */ }*
>
> On Fri, Jun 29, 2012 at 7:19 AM, nilskp wrote:
>
>> $('#foo').popover('hide').popover({ trigger: 'manual' , /* more stuff
>> */}).popover('show');
>>
>
>
>
> --
> Ghoul To World! - http://www.g2w.me
> ScriptFan - http://scriptfan.com/
>
>