Browse Source

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

iou90 5 years ago
parent
commit
1f2a472428
1 changed files with 6 additions and 14 deletions
  1. 6
    14
      autoHeightWebView/common.js

+ 6
- 14
autoHeightWebView/common.js View File

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
   script = files && files.length > 0 ? appendFilesToHead(files, script) : script;
70
   script = files && files.length > 0 ? appendFilesToHead(files, script) : script;
72
   script = appendStylesToHead(customStyle, script);
71
   script = appendStylesToHead(customStyle, script);
73
   customScript && (script = customScript + script);
72
   customScript && (script = customScript + script);
127
   var height = container.offsetHeight || document.body.offsetHeight;
126
   var height = container.offsetHeight || document.body.offsetHeight;
128
   var width = container.offsetWidth || document.body.offsetWidth;
127
   var width = container.offsetWidth || document.body.offsetWidth;
129
   return {
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
+`;