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

Commit

Permalink
Fixed viewport flip positioning bug thanks tiritas
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Aug 27, 2011
1 parent ef7bc9d commit 7a611de
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
10 changes: 5 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: Sat Aug 20 18:18:17 2011 +0100
* Date: Mon Aug 22 01:08:55 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 @@ -1179,10 +1179,10 @@ function QTip(target, options, id, attr)
// Default 'flip' repositioning
else {
if(overflowLeft > 0 && (my.x !== 'left' || overflowRight > 0)) {
position.left -= offset + (isCenter ? 0 : 2 * adjust.x);
position.left -= offset;
}
else if(overflowRight > 0 && (my.x !== 'right' || overflowLeft > 0) ) {
position.left -= isCenter ? -offset : offset + (2 * adjust.x);
position.left -= isCenter ? -offset : offset;
}
if(position.left !== posLeft && isCenter) { position.left -= adjust.x; }

Expand Down Expand Up @@ -1224,10 +1224,10 @@ function QTip(target, options, id, attr)
// Default 'flip' repositioning
else {
if(overflowTop > 0 && (my.y !== 'top' || overflowBottom > 0)) {
position.top -= offset + (isCenter ? 0 : 2 * adjust.y);
position.top -= offset;
}
else if(overflowBottom > 0 && (my.y !== 'bottom' || overflowTop > 0) ) {
position.top -= isCenter ? -offset : offset + (2 * adjust.y);
position.top -= isCenter ? -offset : offset;
}
if(position.top !== posTop && isCenter) { position.top -= adjust.y; }

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: Sat Aug 20 18:18:17 2011 +0100
* Date: Mon Aug 22 01:08:55 2011 +0100
*/

/* Core qTip styles */
Expand Down
10 changes: 5 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: Sat Aug 20 18:18:17 2011 +0100
* Date: Mon Aug 22 01:08:55 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 @@ -1179,10 +1179,10 @@ function QTip(target, options, id, attr)
// Default 'flip' repositioning
else {
if(overflowLeft > 0 && (my.x !== 'left' || overflowRight > 0)) {
position.left -= offset + (isCenter ? 0 : 2 * adjust.x);
position.left -= offset;
}
else if(overflowRight > 0 && (my.x !== 'right' || overflowLeft > 0) ) {
position.left -= isCenter ? -offset : offset + (2 * adjust.x);
position.left -= isCenter ? -offset : offset;
}
if(position.left !== posLeft && isCenter) { position.left -= adjust.x; }

Expand Down Expand Up @@ -1224,10 +1224,10 @@ function QTip(target, options, id, attr)
// Default 'flip' repositioning
else {
if(overflowTop > 0 && (my.y !== 'top' || overflowBottom > 0)) {
position.top -= offset + (isCenter ? 0 : 2 * adjust.y);
position.top -= offset;
}
else if(overflowBottom > 0 && (my.y !== 'bottom' || overflowTop > 0) ) {
position.top -= isCenter ? -offset : offset + (2 * adjust.y);
position.top -= isCenter ? -offset : offset;
}
if(position.top !== posTop && isCenter) { position.top -= adjust.y; }

Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.qtip.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/core.js
Expand Up @@ -1116,10 +1116,10 @@ function QTip(target, options, id, attr)
// Default 'flip' repositioning
else {
if(overflowLeft > 0 && (my.x !== 'left' || overflowRight > 0)) {
position.left -= offset + (isCenter ? 0 : 2 * adjust.x);
position.left -= offset;
}
else if(overflowRight > 0 && (my.x !== 'right' || overflowLeft > 0) ) {
position.left -= isCenter ? -offset : offset + (2 * adjust.x);
position.left -= isCenter ? -offset : offset;
}
if(position.left !== posLeft && isCenter) { position.left -= adjust.x; }

Expand Down Expand Up @@ -1161,10 +1161,10 @@ function QTip(target, options, id, attr)
// Default 'flip' repositioning
else {
if(overflowTop > 0 && (my.y !== 'top' || overflowBottom > 0)) {
position.top -= offset + (isCenter ? 0 : 2 * adjust.y);
position.top -= offset;
}
else if(overflowBottom > 0 && (my.y !== 'bottom' || overflowTop > 0) ) {
position.top -= isCenter ? -offset : offset + (2 * adjust.y);
position.top -= isCenter ? -offset : offset;
}
if(position.top !== posTop && isCenter) { position.top -= adjust.y; }

Expand Down

0 comments on commit 7a611de

Please sign in to comment.