|
@@ -77,17 +77,14 @@ export default class AutoHeightWebView extends PureComponent {
|
77
|
77
|
if (!files) {
|
78
|
78
|
return script;
|
79
|
79
|
}
|
80
|
|
- for (let file of files) {
|
81
|
|
- script =
|
82
|
|
- `
|
83
|
|
- var link = document.createElement('link');
|
84
|
|
- link.rel = '` + file.rel + `';
|
85
|
|
- link.type = '` + file.type + `';
|
86
|
|
- link.href = '` + file.href + `';
|
87
|
|
- document.head.appendChild(link);
|
88
|
|
- `+ script;
|
89
|
|
- }
|
90
|
|
- return script;
|
|
80
|
+ return files.reduceRight((file, combinedScript) => `
|
|
81
|
+ var link = document.createElement('link');
|
|
82
|
+ link.rel = '${file.rel}';
|
|
83
|
+ link.type = '${file.type}';
|
|
84
|
+ link.href = '${file.href}';
|
|
85
|
+ document.head.appendChild(link);
|
|
86
|
+ ${combinedScript}
|
|
87
|
+ `, script)
|
91
|
88
|
}
|
92
|
89
|
|
93
|
90
|
appendStylesToHead(styles, script) {
|