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

Commit

Permalink
Added code to prevent parallel calling of reposition method
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Dec 9, 2010
1 parent 3770742 commit 1ea1e32
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion dist/jquery.qtip.css
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Thu Dec 9 04:00:53 2010 +0000
* Date: Thu Dec 9 04:03:40 2010 +0000
*/

.ui-tooltip-accessible{
Expand Down
14 changes: 9 additions & 5 deletions dist/jquery.qtip.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Thu Dec 9 04:00:53 2010 +0000
* Date: Thu Dec 9 04:03:40 2010 +0000
*/

"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
Expand Down Expand Up @@ -974,7 +974,11 @@ function QTip(target, options, id)

reposition: function(event)
{
if(self.rendered === FALSE) { return FALSE; }
// Return if tooltip isn't rendered or we're already processing a previous call
if(self.rendered === FALSE || self.cache.processing) { return FALSE; }

// Set processing flag and continue otherwise
else { self.cache.processing = 1; }

var target = options.position.target,
tooltip = self.elements.tooltip,
Expand Down Expand Up @@ -1039,9 +1043,6 @@ function QTip(target, options, id)
scrollTop: viewport.scrollTop()
};




// Check if mouse was the target
if(target === 'mouse') {
// Force left top to allow flipping
Expand Down Expand Up @@ -1138,6 +1139,9 @@ function QTip(target, options, id)
tooltip.css(position);
}

// Revoke processing flag now we're done
self.cache.processing = 0;

return self;
},

Expand Down
20 changes: 10 additions & 10 deletions dist/jquery.qtip.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/jquery.qtip.pack.js

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions src/core.js
Expand Up @@ -949,7 +949,11 @@ function QTip(target, options, id)

reposition: function(event)
{
if(self.rendered === FALSE) { return FALSE; }
// Return if tooltip isn't rendered or we're already processing a previous call
if(self.rendered === FALSE || self.cache.processing) { return FALSE; }

// Set processing flag and continue otherwise
else { self.cache.processing = 1; }

var target = options.position.target,
tooltip = self.elements.tooltip,
Expand Down Expand Up @@ -1014,9 +1018,6 @@ function QTip(target, options, id)
scrollTop: viewport.scrollTop()
};




// Check if mouse was the target
if(target === 'mouse') {
// Force left top to allow flipping
Expand Down Expand Up @@ -1113,6 +1114,9 @@ function QTip(target, options, id)
tooltip.css(position);
}

// Revoke processing flag now we're done
self.cache.processing = 0;

return self;
},

Expand Down

0 comments on commit 1ea1e32

Please sign in to comment.