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

Commit

Permalink
Tidy up core.js code
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Feb 21, 2012
1 parent e53519f commit 6ff3d1e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 25 deletions.
15 changes: 7 additions & 8 deletions dist/jquery.qtip.basic.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Tue Feb 7 21:29:55 2012 +0000
* Date: Tue Feb 21 04:13:49 2012 +0000
*/

/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
Expand Down Expand Up @@ -394,18 +394,17 @@ function QTip(target, options, id, attr)
// Skip if the src is already present
if(srcs[elem.src] !== undefined) { return; }

// Keep track of how many times we poll for image dimensions.
// If it doesn't return in a reasonable amount of time, it's better
// to display the tooltip, rather than hold up the queue.
var iterations = 0, maxIterations = 3;
// Keep track of how many times we poll for image dimensions.
// If it doesn't return in a reasonable amount of time, it's better
// to display the tooltip, rather than hold up the queue.
var iterations = 0, maxIterations = 3;

(function timer(){
// When the dimensions are found, remove the image from the queue
if(elem.height || elem.width || (iterations > maxIterations)) { return imageLoad(elem); }

iterations += 1;

// Restart timer
// Increase iterations and restart timer
iterations += 1;
self.timers.img[elem.src] = setTimeout(timer, 700);
}());

Expand Down
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: Tue Feb 7 21:29:55 2012 +0000
* Date: Tue Feb 21 04:13:49 2012 +0000
*/

/* Core qTip styles */
Expand Down
15 changes: 7 additions & 8 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: Tue Feb 7 21:29:55 2012 +0000
* Date: Tue Feb 21 04:13:49 2012 +0000
*/

/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
Expand Down Expand Up @@ -394,18 +394,17 @@ function QTip(target, options, id, attr)
// Skip if the src is already present
if(srcs[elem.src] !== undefined) { return; }

// Keep track of how many times we poll for image dimensions.
// If it doesn't return in a reasonable amount of time, it's better
// to display the tooltip, rather than hold up the queue.
var iterations = 0, maxIterations = 3;
// Keep track of how many times we poll for image dimensions.
// If it doesn't return in a reasonable amount of time, it's better
// to display the tooltip, rather than hold up the queue.
var iterations = 0, maxIterations = 3;

(function timer(){
// When the dimensions are found, remove the image from the queue
if(elem.height || elem.width || (iterations > maxIterations)) { return imageLoad(elem); }

iterations += 1;

// Restart timer
// Increase iterations and restart timer
iterations += 1;
self.timers.img[elem.src] = setTimeout(timer, 700);
}());

Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.qtip.min.js

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions src/core.js
Expand Up @@ -331,18 +331,17 @@ function QTip(target, options, id, attr)
// Skip if the src is already present
if(srcs[elem.src] !== undefined) { return; }

// Keep track of how many times we poll for image dimensions.
// If it doesn't return in a reasonable amount of time, it's better
// to display the tooltip, rather than hold up the queue.
var iterations = 0, maxIterations = 3;
// Keep track of how many times we poll for image dimensions.
// If it doesn't return in a reasonable amount of time, it's better
// to display the tooltip, rather than hold up the queue.
var iterations = 0, maxIterations = 3;

(function timer(){
// When the dimensions are found, remove the image from the queue
if(elem.height || elem.width || (iterations > maxIterations)) { return imageLoad(elem); }

iterations += 1;

// Restart timer
// Increase iterations and restart timer
iterations += 1;
self.timers.img[elem.src] = setTimeout(timer, 700);
}());

Expand Down

0 comments on commit 6ff3d1e

Please sign in to comment.