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

Commit

Permalink
Fixed issue with position: fixed; tooltip positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Apr 26, 2011
1 parent 96fb6a0 commit 4430dfa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 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: Mon Apr 25 19:59:02 2011 +0100
* Date: Tue Apr 26 01:43:27 2011 +0100
*/

/* Fluid class for determining actual width in IE */
Expand Down
10 changes: 6 additions & 4 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 Apr 25 19:59:02 2011 +0100
* Date: Tue Apr 26 01:43:27 2011 +0100
*/

"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 @@ -1225,7 +1225,7 @@ function QTip(target, options, id, attr)
targetWidth = target.outerWidth();
targetHeight = target.outerHeight();

position = PLUGINS.offset(target, posOptions.container);
position = PLUGINS.offset(target, posOptions.container, fixed);
}

// Parse returned plugin values into proper variables
Expand Down Expand Up @@ -1615,7 +1615,7 @@ PLUGINS = QTIP.plugins = {
},

// Custom (more correct for qTip!) offset calculator
offset: function(elem, container) {
offset: function(elem, container, fixed) {
var pos = elem.offset(),
parent = container,
deep = 0,
Expand Down Expand Up @@ -1643,7 +1643,9 @@ PLUGINS = QTIP.plugins = {

// Compensate for containers scroll if it also has an offsetParent
if(container[0] !== docBody || deep > 1) { scroll( container, 1 ); }
if(PLUGINS.iOS < 4.1 && PLUGINS.iOS > 3.1) { scroll( $(window), -1 ); }

// Adjust for position.fixed tooltips (and also iOS scroll bug in v3.2 - v4.0)
if((PLUGINS.iOS < 4.1 && PLUGINS.iOS > 3.1) || (!PLUGINS.iOS && fixed)) { scroll( $(window), -1 ); }
}

return pos;
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.

8 changes: 5 additions & 3 deletions src/core.js
Expand Up @@ -1182,7 +1182,7 @@ function QTip(target, options, id, attr)
targetWidth = target.outerWidth();
targetHeight = target.outerHeight();

position = PLUGINS.offset(target, posOptions.container);
position = PLUGINS.offset(target, posOptions.container, fixed);
}

// Parse returned plugin values into proper variables
Expand Down Expand Up @@ -1572,7 +1572,7 @@ PLUGINS = QTIP.plugins = {
},

// Custom (more correct for qTip!) offset calculator
offset: function(elem, container) {
offset: function(elem, container, fixed) {
var pos = elem.offset(),
parent = container,
deep = 0,
Expand Down Expand Up @@ -1600,7 +1600,9 @@ PLUGINS = QTIP.plugins = {

// Compensate for containers scroll if it also has an offsetParent
if(container[0] !== docBody || deep > 1) { scroll( container, 1 ); }
if(PLUGINS.iOS < 4.1 && PLUGINS.iOS > 3.1) { scroll( $(window), -1 ); }

// Adjust for position.fixed tooltips (and also iOS scroll bug in v3.2 - v4.0)
if((PLUGINS.iOS < 4.1 && PLUGINS.iOS > 3.1) || (!PLUGINS.iOS && fixed)) { scroll( $(window), -1 ); }
}

return pos;
Expand Down

0 comments on commit 4430dfa

Please sign in to comment.