Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Something went wrong in last commit, detectFunc returned undefined

  • Loading branch information...
commit c440806fa848fef644286476bc9c855195595d36 1 parent bc9872d
@tombigel tombigel authored
Showing with 37 additions and 36 deletions.
  1. +37 −36 detect-zoom.js
View
73 detect-zoom.js
@@ -5,7 +5,7 @@
* dual-licensed under the WTFPL and MIT license
* Maintained by https://github/tombigel
* Original developer https://github.com/yonran
-*/
+ */
//AMD and CommonJS initialization copied from https://github.com/zohararad/audio5js
(function (root, ns, factory) {
@@ -24,41 +24,6 @@
}(window, 'detectZoom', function () {
/**
- * Generate detection function
- * @private
- */
- var detectFunction = (function () {
- var func = fallback;
- //IE8+
- if (!isNaN(screen.logicalXDPI) && !isNaN(screen.systemXDPI)) {
- func = ie8;
- }
- //Mobile Webkit
- else if ('ontouchstart' in window && typeof document.body.style.webkitTextSizeAdjust === 'string') {
- func = webkitMobile;
- }
- //WebKit
- else if (typeof document.body.style.webkitTextSizeAdjust === 'string') {
- func = webkit;
- }
- //Opera
- else if (navigator.userAgent.indexOf('Opera') >= 0) {
- func = opera11;
- }
- //Last one is Firefox
- //FF 18.x
- else if (window.devicePixelRatio) {
- func = firefox18;
- }
- //FF 4.0 - 17.x
- else if (firefox4().zoom > 0.001) {
- func = firefox4;
- }
-
- return func;
- }());
-
- /**
* Use devicePixelRatio if supported by the browser
* @return {Number}
* @private
@@ -259,6 +224,42 @@
}
};
+ /**
+ * Generate detection function
+ * @private
+ */
+ var detectFunction = (function () {
+ var func = fallback;
+ //IE8+
+ if (!isNaN(screen.logicalXDPI) && !isNaN(screen.systemXDPI)) {
+ func = ie8;
+ }
+ //Mobile Webkit
+ else if ('ontouchstart' in window && typeof document.body.style.webkitTextSizeAdjust === 'string') {
+ func = webkitMobile;
+ }
+ //WebKit
+ else if (typeof document.body.style.webkitTextSizeAdjust === 'string') {
+ func = webkit;
+ }
+ //Opera
+ else if (navigator.userAgent.indexOf('Opera') >= 0) {
+ func = opera11;
+ }
+ //Last one is Firefox
+ //FF 18.x
+ else if (window.devicePixelRatio) {
+ func = firefox18;
+ }
+ //FF 4.0 - 17.x
+ else if (firefox4().zoom > 0.001) {
+ func = firefox4;
+ }
+
+ return func;
+ }());
+
+
return ({
/**
Please sign in to comment.
Something went wrong with that request. Please try again.