bootstrapx-clickover icon indicating copy to clipboard operation
bootstrapx-clickover copied to clipboard

Option 'hide' does not work

Open hxhieu opened this issue 12 years ago • 6 comments

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

hxhieu avatar Sep 29 '12 23:09 hxhieu

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();
});

lecar-red avatar Oct 02 '12 15:10 lecar-red

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 avatar Oct 02 '12 20:10 hxhieu

does that work differently if you do:

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

lecar-red avatar Oct 04 '12 23:10 lecar-red

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

aturkelson avatar Jan 26 '13 06:01 aturkelson

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 ...

kaxline avatar Feb 12 '13 14:02 kaxline

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

should do it

enginehouse avatar Nov 16 '13 19:11 enginehouse