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

Commit

Permalink
Ensure reposition and redraw are only called once during initial render
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Jul 25, 2011
1 parent 8f540e6 commit c1809f8
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 19 deletions.
13 changes: 8 additions & 5 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: Mon Jul 25 12:20:22 2011 +0100
* Date: Mon Jul 25 12:24:43 2011 +0100
*/

/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
Expand Down Expand Up @@ -756,9 +756,9 @@ function QTip(target, options, id, attr)
})
);

// Set rendered flag and prevent redundant redraw calls for npw
// Set rendered flag and prevent redundant redraw/reposition calls for now
self.rendered = -1;
isDrawing = 1;
isDrawing = 1; isPositioning = 1;

// Update title
if(title) {
Expand Down Expand Up @@ -798,10 +798,13 @@ function QTip(target, options, id, attr)
callback.originalEvent = cache.event;
tooltip.trigger(callback, [self]);

// Reset flags
isDrawing = 0; isPositioning = 0;

// Redraw the tooltip manually now we're fully rendered
isDrawing = 0; self.redraw();
self.redraw();

// Update tooltip position and show tooltip if needed
// Show tooltip if needed
if(options.show.ready || show) {
self.toggle(TRUE, cache.event);
}
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: Mon Jul 25 12:20:22 2011 +0100
* Date: Mon Jul 25 12:24:43 2011 +0100
*/

/* Core qTip styles */
Expand Down
13 changes: 8 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: Mon Jul 25 12:20:22 2011 +0100
* Date: Mon Jul 25 12:24:43 2011 +0100
*/

/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
Expand Down Expand Up @@ -756,9 +756,9 @@ function QTip(target, options, id, attr)
})
);

// Set rendered flag and prevent redundant redraw calls for npw
// Set rendered flag and prevent redundant redraw/reposition calls for now
self.rendered = -1;
isDrawing = 1;
isDrawing = 1; isPositioning = 1;

// Update title
if(title) {
Expand Down Expand Up @@ -798,10 +798,13 @@ function QTip(target, options, id, attr)
callback.originalEvent = cache.event;
tooltip.trigger(callback, [self]);

// Reset flags
isDrawing = 0; isPositioning = 0;

// Redraw the tooltip manually now we're fully rendered
isDrawing = 0; self.redraw();
self.redraw();

// Update tooltip position and show tooltip if needed
// Show tooltip if needed
if(options.show.ready || show) {
self.toggle(TRUE, cache.event);
}
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.qtip.min.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions src/core.js
Expand Up @@ -693,9 +693,9 @@ function QTip(target, options, id, attr)
})
);

// Set rendered flag and prevent redundant redraw calls for npw
// Set rendered flag and prevent redundant redraw/reposition calls for now
self.rendered = -1;
isDrawing = 1;
isDrawing = 1; isPositioning = 1;

// Update title
if(title) {
Expand Down Expand Up @@ -735,10 +735,13 @@ function QTip(target, options, id, attr)
callback.originalEvent = cache.event;
tooltip.trigger(callback, [self]);

// Reset flags
isDrawing = 0; isPositioning = 0;

// Redraw the tooltip manually now we're fully rendered
isDrawing = 0; self.redraw();
self.redraw();

// Update tooltip position and show tooltip if needed
// Show tooltip if needed
if(options.show.ready || show) {
self.toggle(TRUE, cache.event);
}
Expand Down

0 comments on commit c1809f8

Please sign in to comment.