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

Commit

Permalink
Final iOS fix... FUUUUUUUUUU iPhone!
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Apr 13, 2011
1 parent 94801a0 commit 4d80659
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 31 deletions.
15 changes: 6 additions & 9 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: Wed Apr 13 23:43:02 2011 +0100
* Date: Wed Apr 13 23:51: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 @@ -1591,7 +1591,7 @@ 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) { scroll( $(window), -1 ); }
if(PLUGINS.iOS < 4.1 && PLUGINS.iOS > 3.1) { scroll( $(window), -1 ); }
}

return pos;
Expand All @@ -1600,13 +1600,10 @@ PLUGINS = QTIP.plugins = {
/*
* iOS 3.2 - 4.0 scroll fix detection used in offset() function.
*/
iOS: (function() {
var v = parseFloat(
('' + (/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,'4_2'])[1])
.replace('undefined', '3_2').replace('_','.')
);
return v < 4.1 && v > 3.1;
}()),
iOS: parseFloat(
('' + (/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,'4_2'])[1])
.replace('undefined', '3_2').replace('_','.')
),

/*
* jQuery-secpfic $.fn overrides
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: Wed Apr 13 23:43:02 2011 +0100
* Date: Wed Apr 13 23:51:41 2011 +0100
*/

/* Fluid class for determining actual width in IE */
Expand Down
15 changes: 6 additions & 9 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: Wed Apr 13 23:43:02 2011 +0100
* Date: Wed Apr 13 23:51: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 @@ -1591,7 +1591,7 @@ 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) { scroll( $(window), -1 ); }
if(PLUGINS.iOS < 4.1 && PLUGINS.iOS > 3.1) { scroll( $(window), -1 ); }
}

return pos;
Expand All @@ -1600,13 +1600,10 @@ PLUGINS = QTIP.plugins = {
/*
* iOS 3.2 - 4.0 scroll fix detection used in offset() function.
*/
iOS: (function() {
var v = parseFloat(
('' + (/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,'4_2'])[1])
.replace('undefined', '3_2').replace('_','.')
);
return v < 4.1 && v > 3.1;
}()),
iOS: parseFloat(
('' + (/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,'4_2'])[1])
.replace('undefined', '3_2').replace('_','.')
),

/*
* jQuery-secpfic $.fn overrides
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.

13 changes: 5 additions & 8 deletions src/core.js
Expand Up @@ -1549,7 +1549,7 @@ 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) { scroll( $(window), -1 ); }
if(PLUGINS.iOS < 4.1 && PLUGINS.iOS > 3.1) { scroll( $(window), -1 ); }
}

return pos;
Expand All @@ -1558,13 +1558,10 @@ PLUGINS = QTIP.plugins = {
/*
* iOS 3.2 - 4.0 scroll fix detection used in offset() function.
*/
iOS: (function() {
var v = parseFloat(
('' + (/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,'4_2'])[1])
.replace('undefined', '3_2').replace('_','.')
);
return v < 4.1 && v > 3.1;
}()),
iOS: parseFloat(
('' + (/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,'4_2'])[1])
.replace('undefined', '3_2').replace('_','.')
),

/*
* jQuery-secpfic $.fn overrides
Expand Down

0 comments on commit 4d80659

Please sign in to comment.