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

Double-clicking bubbles results in a persistent bubble and undesirable behavior #2

Closed
ChrisCooper opened this issue Oct 30, 2012 · 3 comments

Comments

@ChrisCooper
Copy link

E.g. If you double-click bubble # 1, bubbles #2 and #3 both show. Bubble #2 is no longer clickable or hoverable, and when bubble #3 is clicked, it only dismisses #2. Bubble #3 will stay around until the entire routine is over.

@technotarek
Copy link

Just clarifying/confirming this issue. Since bubbles are triggered by each subsequent click, as many bubbles will appear as the times one clicks (until all bubbles have been displayed). That is to say, so long as there are 3 bubbles remaining, a triple click will expose three more bubbles, 4 clicks will display 4 bubbles etc etc. To resolve the issue, consider adding code that checks the display status of the previous bubble before a new one is displayed (i.e., only show the next bubble on click if the previous bubble is hidden). This might be helpful: http://stackoverflow.com/questions/178325/testing-if-something-is-hidden-with-jquery

@tommoor
Copy link
Owner

tommoor commented Nov 15, 2012

Thanks guys, i'll look at a solution for this

@ghost
Copy link

ghost commented Nov 22, 2012

Sorry for the quick & messy fork. Try this fix:

$grumble.click(function(ev){
    ev.stopImmediatePropagation();
    // jQuery dblclick event fires click event twice.
    // So, we need to check manually if click was already fired saving current timestamp.
    var lastClick = parseInt($(this).data('CrumbleLastClick'));
    if (isNaN(lastClick)){
        lastClick = 0;
    }
    if (ev.timeStamp - lastClick > 300){
        $(this).data('CrumbleLastClick', ev.timeStamp);
        $current.trigger('hide.bubble');
    }
});

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

3 participants