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

Commit

Permalink
redraw is now used on all browsers to ensure proper max/min dimension…
Browse files Browse the repository at this point in the history
…s and viewport adjustment. Also fixed problem with it being called multiple times
  • Loading branch information
Craga89 committed Mar 8, 2011
1 parent aed2818 commit 1035bbb
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 33 deletions.
6 changes: 1 addition & 5 deletions dist/jquery.qtip.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Thu Mar 3 18:10:01 2011 +0000
* Date: Sun Mar 6 23:40:54 2011 +0000
*/

/* Fluid class for determining actual width in IE */
Expand All @@ -18,10 +18,6 @@
visibility: hidden;
position: static !important;
float: left !important;
max-width: none !important;
min-width: 0px !important;
max-height: none !important;
min-height: 0px !important;
}

.ui-tooltip, .qtip, .ui-tooltip-hidden{
Expand Down
22 changes: 12 additions & 10 deletions dist/jquery.qtip.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Thu Mar 3 18:10:01 2011 +0000
* Date: Sun Mar 6 23:40:54 2011 +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 @@ -700,14 +700,15 @@ function QTip(target, options, id, attr)
})
);

// Set rendered status
self.rendered = TRUE;

// Update title and content
// Update title
self.rendered = -1;
if(title) {
createTitle();
updateTitle(title);
}

// Set proper rendered flag and update content
self.rendered = TRUE;
updateContent(content);

// Setup widget classes
Expand Down Expand Up @@ -1197,20 +1198,21 @@ function QTip(target, options, id, attr)
// IE max/min height/width simulartor function
redraw: function()
{
// Make sure tooltip is rendered and the browser needs the redraw
if(!self.rendered || !($.browser.msie && $.browser.version < 8)) { return FALSE; }
var fluid = uitooltip + '-fluid',
auto = 'auto', dimensions;

var fluid = uitooltip + '-fluid', dimensions;
// Return if tooltip is not rendered
if(self.rendered < 1) { return FALSE; }

// Reset the height and width and add the fluid class to reset max/min widths
tooltip.css({ width: 'auto', height: 'auto' }).addClass(fluid);
tooltip.css({ width: auto, height: auto }).addClass(fluid);

// Grab our tooltip dimensions
dimensions = {
height: tooltip.outerHeight(),
width: tooltip.outerWidth()
};

// Determine actual width
$.each(['width', 'height'], function(i, prop) {
// Parse our max/min properties
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.qtip.min.css

Large diffs are not rendered by default.

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.

4 changes: 0 additions & 4 deletions src/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
visibility: hidden;
position: static !important;
float: left !important;
max-width: none !important;
min-width: 0px !important;
max-height: none !important;
min-height: 0px !important;
}

.ui-tooltip, .qtip, .ui-tooltip-hidden{
Expand Down
20 changes: 11 additions & 9 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,14 +658,15 @@ function QTip(target, options, id, attr)
})
);

// Set rendered status
self.rendered = TRUE;

// Update title and content
// Update title
self.rendered = -1;
if(title) {
createTitle();
updateTitle(title);
}

// Set proper rendered flag and update content
self.rendered = TRUE;
updateContent(content);

// Setup widget classes
Expand Down Expand Up @@ -1155,20 +1156,21 @@ function QTip(target, options, id, attr)
// IE max/min height/width simulartor function
redraw: function()
{
// Make sure tooltip is rendered and the browser needs the redraw
if(!self.rendered || !($.browser.msie && $.browser.version < 8)) { return FALSE; }
var fluid = uitooltip + '-fluid',
auto = 'auto', dimensions;

var fluid = uitooltip + '-fluid', dimensions;
// Return if tooltip is not rendered
if(self.rendered < 1) { return FALSE; }

// Reset the height and width and add the fluid class to reset max/min widths
tooltip.css({ width: 'auto', height: 'auto' }).addClass(fluid);
tooltip.css({ width: auto, height: auto }).addClass(fluid);

// Grab our tooltip dimensions
dimensions = {
height: tooltip.outerHeight(),
width: tooltip.outerWidth()
};

// Determine actual width
$.each(['width', 'height'], function(i, prop) {
// Parse our max/min properties
Expand Down

0 comments on commit 1035bbb

Please sign in to comment.