Skip to content

Commit d21b992

Browse files
committed
fix(loading): use fetch instead of iframe
1 parent c9faea5 commit d21b992

4 files changed

Lines changed: 16 additions & 40 deletions

File tree

vue2-app/public/index.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
<noscript>
1818
<strong>We're sorry but trame built by Kitware doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
1919
</noscript>
20-
<div id="app">
21-
<iframe src="./loading/index.html" style="position:absolute;top:0;left:0;width:100%;height:100%;z-index:1000;border:none;">
22-
</iframe>
23-
</div>
20+
<div id="app"></div>
21+
<script>fetch("./loading.tpl").then((r) => r.text()).then((c) => document.querySelector("#app").innerHTML = c)</script>
2422
<!-- built files will be auto injected -->
2523
</body>
2624
</html>
Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1">
6-
<title>Loading...</title>
7-
<style>
1+
<style>
82
.text-no-select {
93
-webkit-user-select: none;
104
-moz-user-select: none;
@@ -90,12 +84,8 @@
9084
transform: rotate(360deg); /* Firefox 16+, IE 10+, Opera */
9185
}
9286
}
93-
</style>
94-
</head>
95-
<body>
96-
<div style="position:absolute;top:0;left:0;width:100%;height:100%;z-index:1000;">
97-
<div class="trame__loader"></div>
98-
<div class="trame__message">Loading...</div>
99-
</div>
100-
</body>
101-
</html>
87+
</style>
88+
<div style="position:absolute;top:0;left:0;width:100%;height:100%;z-index:1000;">
89+
<div class="trame__loader"></div>
90+
<div class="trame__message">Loading...</div>
91+
</div>

vue3-app/index.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616
<noscript>
1717
<strong>We're sorry but trame built by Kitware doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
1818
</noscript>
19-
<div id="app">
20-
<iframe src="./loading/index.html" style="position:absolute;top:0;left:0;width:100%;height:100%;z-index:1000;border:none;">
21-
</iframe>
22-
</div>
19+
<div id="app"></div>
20+
<script>fetch("./loading.tpl").then((r) => r.text()).then((c) => document.querySelector("#app").innerHTML = c)</script>
2321
<script type="module" src="/src/main.js"></script>
2422
</body>
2523
</html>
Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1">
6-
<title>Loading...</title>
7-
<style>
1+
<style>
82
.text-no-select {
93
-webkit-user-select: none;
104
-moz-user-select: none;
@@ -90,12 +84,8 @@
9084
transform: rotate(360deg); /* Firefox 16+, IE 10+, Opera */
9185
}
9286
}
93-
</style>
94-
</head>
95-
<body>
96-
<div style="position:absolute;top:0;left:0;width:100%;height:100%;z-index:1000;">
97-
<div class="trame__loader"></div>
98-
<div class="trame__message">Loading...</div>
99-
</div>
100-
</body>
101-
</html>
87+
</style>
88+
<div style="position:absolute;top:0;left:0;width:100%;height:100%;z-index:1000;">
89+
<div class="trame__loader"></div>
90+
<div class="trame__message">Loading...</div>
91+
</div>

0 commit comments

Comments
 (0)