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 viewport containers left hand side not being respected
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Apr 14, 2011
1 parent 1adfef1 commit 39d4933
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
9 changes: 5 additions & 4 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: Thu Apr 14 20:08:23 2011 +0100
* Date: Thu Apr 14 20:23:41 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 @@ -1055,7 +1055,7 @@ function QTip(target, options, id, attr)
// Make sure this axis is enabled for reposition
if (!readjust.horizontal) { return 0; }

var viewportScroll = viewport.scrollLeft,
var viewportScroll = (viewport.offset.left || 0) + viewport.scrollLeft,
myWidth = my.x === 'left' ? elemWidth : my.x === 'right' ? -elemWidth : -elemWidth / 2,
atWidth = at.x === 'left' ? targetWidth : at.x === 'right' ? -targetWidth : -targetWidth / 2,
tipAdjust = tip && tip.precedance === 'x' ? options.style.tip.width : 0,
Expand Down Expand Up @@ -1089,7 +1089,7 @@ function QTip(target, options, id, attr)
// Make sure this axis is enabled for reposition
if (!readjust.vertical) { return 0; }

var viewportScroll = viewport.scrollTop,
var viewportScroll = (viewport.offset.top || 0) + viewport.scrollTop,
myHeight = my.y === 'top' ? elemHeight : my.y === 'bottom' ? -elemHeight : -elemHeight / 2,
atHeight = at.y === 'top' ? targetHeight : at.y === 'bottom' ? -targetHeight : -targetHeight / 2,
tipAdjust = tip && tip.precedance === 'y' ? options.style.tip.height : 0,
Expand Down Expand Up @@ -1127,7 +1127,8 @@ function QTip(target, options, id, attr)
height: viewport[ (viewport[0] === window ? 'h' : 'outerH') + 'eight' ](),
width: viewport[ (viewport[0] === window ? 'w' : 'outerW') + 'idth' ](),
scrollLeft: viewport.scrollLeft(),
scrollTop: viewport.scrollTop()
scrollTop: viewport.scrollTop(),
offset: viewport.offset() || {}
};

// Check if mouse was the target
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: Thu Apr 14 20:08:23 2011 +0100
* Date: Thu Apr 14 20:23:41 2011 +0100
*/

/* Fluid class for determining actual width in IE */
Expand Down
9 changes: 5 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: Thu Apr 14 20:08:23 2011 +0100
* Date: Thu Apr 14 20:23:41 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 @@ -1055,7 +1055,7 @@ function QTip(target, options, id, attr)
// Make sure this axis is enabled for reposition
if (!readjust.horizontal) { return 0; }

var viewportScroll = viewport.scrollLeft,
var viewportScroll = (viewport.offset.left || 0) + viewport.scrollLeft,
myWidth = my.x === 'left' ? elemWidth : my.x === 'right' ? -elemWidth : -elemWidth / 2,
atWidth = at.x === 'left' ? targetWidth : at.x === 'right' ? -targetWidth : -targetWidth / 2,
tipAdjust = tip && tip.precedance === 'x' ? options.style.tip.width : 0,
Expand Down Expand Up @@ -1089,7 +1089,7 @@ function QTip(target, options, id, attr)
// Make sure this axis is enabled for reposition
if (!readjust.vertical) { return 0; }

var viewportScroll = viewport.scrollTop,
var viewportScroll = (viewport.offset.top || 0) + viewport.scrollTop,
myHeight = my.y === 'top' ? elemHeight : my.y === 'bottom' ? -elemHeight : -elemHeight / 2,
atHeight = at.y === 'top' ? targetHeight : at.y === 'bottom' ? -targetHeight : -targetHeight / 2,
tipAdjust = tip && tip.precedance === 'y' ? options.style.tip.height : 0,
Expand Down Expand Up @@ -1127,7 +1127,8 @@ function QTip(target, options, id, attr)
height: viewport[ (viewport[0] === window ? 'h' : 'outerH') + 'eight' ](),
width: viewport[ (viewport[0] === window ? 'w' : 'outerW') + 'idth' ](),
scrollLeft: viewport.scrollLeft(),
scrollTop: viewport.scrollTop()
scrollTop: viewport.scrollTop(),
offset: viewport.offset() || {}
};

// Check if mouse was the target
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.

7 changes: 4 additions & 3 deletions src/core.js
Expand Up @@ -1013,7 +1013,7 @@ function QTip(target, options, id, attr)
// Make sure this axis is enabled for reposition
if (!readjust.horizontal) { return 0; }

var viewportScroll = viewport.scrollLeft,
var viewportScroll = (viewport.offset.left || 0) + viewport.scrollLeft,
myWidth = my.x === 'left' ? elemWidth : my.x === 'right' ? -elemWidth : -elemWidth / 2,
atWidth = at.x === 'left' ? targetWidth : at.x === 'right' ? -targetWidth : -targetWidth / 2,
tipAdjust = tip && tip.precedance === 'x' ? options.style.tip.width : 0,
Expand Down Expand Up @@ -1047,7 +1047,7 @@ function QTip(target, options, id, attr)
// Make sure this axis is enabled for reposition
if (!readjust.vertical) { return 0; }

var viewportScroll = viewport.scrollTop,
var viewportScroll = (viewport.offset.top || 0) + viewport.scrollTop,
myHeight = my.y === 'top' ? elemHeight : my.y === 'bottom' ? -elemHeight : -elemHeight / 2,
atHeight = at.y === 'top' ? targetHeight : at.y === 'bottom' ? -targetHeight : -targetHeight / 2,
tipAdjust = tip && tip.precedance === 'y' ? options.style.tip.height : 0,
Expand Down Expand Up @@ -1085,7 +1085,8 @@ function QTip(target, options, id, attr)
height: viewport[ (viewport[0] === window ? 'h' : 'outerH') + 'eight' ](),
width: viewport[ (viewport[0] === window ? 'w' : 'outerW') + 'idth' ](),
scrollLeft: viewport.scrollLeft(),
scrollTop: viewport.scrollTop()
scrollTop: viewport.scrollTop(),
offset: viewport.offset() || {}
};

// Check if mouse was the target
Expand Down

0 comments on commit 39d4933

Please sign in to comment.