Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Better destroy handling. Ensure we always hide even if FALSE is retur…
Browse files Browse the repository at this point in the history
…ned in a hide callback, is we're currently destroying.
  • Loading branch information
Craga89 committed Mar 10, 2013
1 parent 85e01f5 commit aed4705
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 18 deletions.
4 changes: 2 additions & 2 deletions dist/jquery.qtip.css
@@ -1,12 +1,12 @@
/*!
* qTip2 - Pretty powerful tooltips - v2.0.1-33-
* qTip2 - Pretty powerful tooltips - v2.0.1-34-
* http://qtip2.com
*
* Copyright (c) 2013 Craig Michael Thompson
* Released under the MIT, GPL licenses
* http://jquery.org/license
*
* Date: Sun Mar 10 2013 01:34 GMT+0000
* Date: Sun Mar 10 2013 01:45 GMT+0000
* Plugins: svg ajax tips modal viewport imagemap ie6
* Styles: basic css3
*/
Expand Down
25 changes: 17 additions & 8 deletions dist/jquery.qtip.js
@@ -1,12 +1,12 @@
/*!
* qTip2 - Pretty powerful tooltips - v2.0.1-33-
* qTip2 - Pretty powerful tooltips - v2.0.1-34-
* http://qtip2.com
*
* Copyright (c) 2013 Craig Michael Thompson
* Released under the MIT, GPL licenses
* http://jquery.org/license
*
* Date: Sun Mar 10 2013 01:34 GMT+0000
* Date: Sun Mar 10 2013 01:45 GMT+0000
* Plugins: svg ajax tips modal viewport imagemap ie6
* Styles: basic css3
*/
Expand Down Expand Up @@ -997,7 +997,7 @@ function QTip(target, options, id, attr)
if(!tooltip.is(':animated') && visible === state && sameTarget) { return self; }

// tooltipshow/tooltiphide events
if(!self._triggerEvent(type, [90])) { return self; }
if(!self._triggerEvent(type, [90]) && !self.destroyed) { return self; }

// Set ARIA hidden status attribute
$.attr(tooltip[0], 'aria-hidden', !!!state);
Expand Down Expand Up @@ -1401,13 +1401,22 @@ function QTip(target, options, id, attr)
delete self.checks;
}

// Destroy after hide if no immediate
if(immediate === TRUE) { process(); }
else {
tooltip.bind('tooltiphidden', process);
var isHiding = FALSE;

// If an immediate destory is needed
if(immediate !== TRUE) {
// Check to see if the hide call below suceeds
tooltip.bind('tooltiphide', function() {
// Set the hiding flag and process on hidden
isHiding = TRUE;
tooltip.bind('tooltiphidden', process);
});
self.hide();
}

// If we're not in the process of hiding... process
if(!isHiding) { process(); }

return target;
}
});
Expand Down Expand Up @@ -1804,7 +1813,7 @@ if(!$.ui) {
}

// Set global qTip properties
QTIP.version = '2.0.1-33-';
QTIP.version = '2.0.1-34-';
QTIP.nextid = 0;
QTIP.inactiveEvents = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' ');
QTIP.zindex = 15000;
Expand Down

0 comments on commit aed4705

Please sign in to comment.