Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move scale fix to a separate directory

  • Loading branch information...
commit 084091eeabdee007e74462f1692df4d8de73b354 1 parent 603aabc
@bebraw authored
Showing with 20 additions and 21 deletions.
  1. +1 −1  index.html
  2. +19 −0 js/scale.fix.js
  3. +0 −20 src/scale.fix.js
View
2  index.html
@@ -11,7 +11,7 @@
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/pygment_trac.css">
<link rel="stylesheet" href="css/colorjoe.css">
- <script src="src/scale.fix.js"></script>
+ <script src="js/scale.fix.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--[if lt IE 9]>
View
19 js/scale.fix.js
@@ -0,0 +1,19 @@
+fixScale = function(doc) {
+
+var addEvent = 'addEventListener',
+ type = 'gesturestart',
+ qsa = 'querySelectorAll',
+ scales = [1, 1],
+ meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];
+
+ function fix() {
+ meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
+ doc.removeEventListener(type, fix, true);
+ }
+
+ if ((meta = meta[meta.length - 1]) && addEvent in doc) {
+ fix();
+ scales = [.25, 1.6];
+ doc[addEvent](type, fix, true);
+ }
+};
View
20 src/scale.fix.js
@@ -1,20 +0,0 @@
-fixScale = function(doc) {
-
- var addEvent = 'addEventListener',
- type = 'gesturestart',
- qsa = 'querySelectorAll',
- scales = [1, 1],
- meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];
-
- function fix() {
- meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
- doc.removeEventListener(type, fix, true);
- }
-
- if ((meta = meta[meta.length - 1]) && addEvent in doc) {
- fix();
- scales = [.25, 1.6];
- doc[addEvent](type, fix, true);
- }
-
-};
Please sign in to comment.
Something went wrong with that request. Please try again.