Browse Source

Fix scaling, zoomedin undefined issue on Android

iou90 4 years ago
parent
commit
19c3f7b392
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      autoHeightWebView/utils.js

+ 2
- 2
autoHeightWebView/utils.js View File

14
 
14
 
15
 const updateSizeWithMessage = (element, scalesPageToFit) =>
15
 const updateSizeWithMessage = (element, scalesPageToFit) =>
16
   `
16
   `
17
+  var scaling = false;
18
+  var zoomedin = false;
17
   var lastHeight = 0;
19
   var lastHeight = 0;
18
   var heightTheSameTimes = 0;
20
   var heightTheSameTimes = 0;
19
   var maxHeightTheSameTimes = 5;
21
   var maxHeightTheSameTimes = 5;
70
 };
72
 };
71
 
73
 
72
 const detectZoomChanged = `
74
 const detectZoomChanged = `
73
-  var zoomedin = false;
74
   var latestTapStamp = 0;
75
   var latestTapStamp = 0;
75
   var lastScale = 1.0;
76
   var lastScale = 1.0;
76
-  var scaling = false;
77
   var doubleTapDelay = 400;
77
   var doubleTapDelay = 400;
78
   function detectZoomChanged() {
78
   function detectZoomChanged() {
79
     var tempZoomedin = (screen.width / window.innerWidth) > 1;
79
     var tempZoomedin = (screen.width / window.innerWidth) > 1;