浏览代码

Fix scaling, zoomedin undefined issue on Android

iou90 4 年前
父节点
当前提交
19c3f7b392
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      autoHeightWebView/utils.js

+ 2
- 2
autoHeightWebView/utils.js 查看文件

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