浏览代码

remove getRenderSize & remove getIframeBaseScript parameter from getScript for common.js

iou90 5 年前
父节点
当前提交
1f2a472428
共有 1 个文件被更改,包括 6 次插入14 次删除
  1. 6
    14
      autoHeightWebView/common.js

+ 6
- 14
autoHeightWebView/common.js 查看文件

@@ -64,10 +64,9 @@ function getInjectedSource(html, script) {
64 64
     `;
65 65
 }
66 66
 
67
-export function getScript(props, getBaseScript, getIframeBaseScript) {
68
-  const { hasIframe, files, customStyle, customScript, style } = getReloadRelatedData(props);
69
-  const baseScript = getBaseScript(style);
70
-  let script = hasIframe && getIframeBaseScript ? getIframeBaseScript(style) : baseScript;
67
+export function getScript(props, getBaseScript) {
68
+  const { files, customStyle, customScript, style } = getReloadRelatedData(props);
69
+  let script = getBaseScript(style);
71 70
   script = files && files.length > 0 ? appendFilesToHead(files, script) : script;
72 71
   script = appendStylesToHead(customStyle, script);
73 72
   customScript && (script = customScript + script);
@@ -127,15 +126,8 @@ function getSize(container) {
127 126
   var height = container.offsetHeight || document.body.offsetHeight;
128 127
   var width = container.offsetWidth || document.body.offsetWidth;
129 128
   return {
130
-    height,
131
-    width
132
-  };
133
-}
134
-`;
135
-
136
-export function getRenderSize(enableAnimation, height, width, heightOffset, heightValue, widthValue) {
137
-  return {
138
-    height: enableAnimation ? heightValue : height ? height + heightOffset : 0,
139
-    width: enableAnimation ? widthValue : width
129
+    height: height,
130
+    width: width
140 131
   };
141 132
 }
133
+`;