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

Commit

Permalink
Updated iPad scroll fix to cover all Mobile Safari devices and minifi…
Browse files Browse the repository at this point in the history
…ed detection logic. Added JSLint suppression option for the new regex to prevent warning when "linting" it ;)
  • Loading branch information
Craga89 committed Nov 3, 2010
1 parent 9e72f04 commit bb6360e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 23 deletions.
5 changes: 3 additions & 2 deletions build/jslint-check.js
Expand Up @@ -2,14 +2,15 @@ load("build/jslint.js");

var src = readFile("dist/jquery.qtip.js");

JSLINT(src, { browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true, forin: true });
JSLINT(src, { evil: true, forin: true, maxerr: 100 });

// All of the following are known issues that we think are 'ok'
// (in contradiction with JSLint) more information here:
// http://docs.jquery.com/JQuery_Core_Style_Guidelines
var ok = {
"Expected an identifier and instead saw 'undefined' (a reserved word).": true,
"Expected a conditional expression and instead saw an assignment.": true
"Expected a conditional expression and instead saw an assignment.": true,
"Insecure '.'.": true
};

var e = JSLINT.errors, found = 0, w;
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 Nov 3 01:57:34 2010 +0000
* Date: Wed Nov 3 02:03:26 2010 +0000
*/

.ui-tooltip-accessible{
Expand Down
9 changes: 3 additions & 6 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 Nov 3 01:57:34 2010 +0000
* Date: Wed Nov 3 02:03:26 2010 +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 @@ -1403,9 +1403,9 @@ $.each({
});
},

/* iPad offset fix - See trac ticket: http://bugs.jquery.com/ticket/6446#comment:1
/* Mobile Safari offset fix - See trac ticket: http://bugs.jquery.com/ticket/6446
*/
offset: !$.fn.qtip.isiPad ? NULL : function() {
offset: parseFloat(((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent)) || [0,'4_2'])[1].replace('_','.')) > 4.1 ? NULL : function() {
var result = $(this).Oldoffset();
result.top -= window.scrollY;
result.left -= window.scrollX;
Expand Down Expand Up @@ -1437,9 +1437,6 @@ $.fn.qtip.nextid = 0;
$.fn.qtip.inactiveEvents = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' ');
$.fn.qtip.zindex = 15000;

// iPad offset problem detection - http://bugs.jquery.com/ticket/6446#comment:1
$.fn.qtip.isiPad = navigator.userAgent.indexOf('iPad') != -1 && /OS (?:3_2|4_0)/i.test(navigator.userAgent);

// Setup base plugins
$.fn.qtip.plugins = {
// Corner object parser
Expand Down
14 changes: 7 additions & 7 deletions dist/jquery.qtip.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/jquery.qtip.pack.js

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions src/core.js
Expand Up @@ -1378,9 +1378,9 @@ $.each({
});
},

/* iPad offset fix - See trac ticket: http://bugs.jquery.com/ticket/6446#comment:1
/* Mobile Safari offset fix - See trac ticket: http://bugs.jquery.com/ticket/6446
*/
offset: !$.fn.qtip.isiPad ? NULL : function() {
offset: parseFloat(((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent)) || [0,'4_2'])[1].replace('_','.')) > 4.1 ? NULL : function() {
var result = $(this).Oldoffset();
result.top -= window.scrollY;
result.left -= window.scrollX;
Expand Down Expand Up @@ -1412,9 +1412,6 @@ $.fn.qtip.nextid = 0;
$.fn.qtip.inactiveEvents = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' ');
$.fn.qtip.zindex = 15000;

// iPad offset problem detection - http://bugs.jquery.com/ticket/6446#comment:1
$.fn.qtip.isiPad = navigator.userAgent.indexOf('iPad') != -1 && /OS (?:3_2|4_0)/i.test(navigator.userAgent);

// Setup base plugins
$.fn.qtip.plugins = {
// Corner object parser
Expand Down

0 comments on commit bb6360e

Please sign in to comment.