Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option 'hide' does not work #19

Open
hxhieu opened this issue Sep 29, 2012 · 6 comments
Open

Option 'hide' does not work #19

hxhieu opened this issue Sep 29, 2012 · 6 comments

Comments

@hxhieu
Copy link

hxhieu commented Sep 29, 2012

Hi,

Sometime you may want to hide the Clickover after some action other than global click or timer and the default $.popover('hide') or $.clickover('hide') is buggy.
I have hacked my way little bit to add another option 'forcehide' and intercept it:

Line 188:
if (typeof option == 'string') {
    if (option === 'forcehide') data.clickery();
    else data[option]();
}

This is just a work around for me to get it done :)

Cheers,
Hugh

@lecar-red
Copy link
Owner

interesting, let me take a look.

Are you calling hide in your own event handler?

Something like:

$(function() { 
  $('body').on('click', '#otherbutton', function(e) { 
  $('#clickover').clickover('hide');
  e.preventDefault();
});

@hxhieu
Copy link
Author

hxhieu commented Oct 2, 2012

Yep, that what I do and the clickover does hide but next time when you trigger it, it won't show up. If you monitor on dev tools you will see the clickover div does get instantiated for a second then gets removed from the DOM tree straight

@hxhieu hxhieu closed this as completed Oct 2, 2012
@hxhieu hxhieu reopened this Oct 2, 2012
@lecar-red
Copy link
Owner

does that work differently if you do:

$('#clickover').data().clickover.hide()

@aturkelson
Copy link

I just ran in to this same issue - has there been any official update?

@kaxline
Copy link

kaxline commented Feb 12, 2013

I was able to get around this by artificially firing a 'click' event on an outside element.

$('#element-outside-clickover').trigger('click')

Total hack, but it works for now ...

@enginehouse
Copy link

$('#element-outside-clickover').clickover('hide').attr("data-clickover-open", 0);

should do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants