Skip to content

Commit 2a0b999

Browse files
committed
assign url_for_main to a variable
1 parent c88406e commit 2a0b999

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

templates/default/fulldoc/html/frames.erb

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
<title><%= options.title %></title>
66
</head>
77
<script type="text/javascript">
8+
var mainUrl = '<%= url_for_main %>'
89
try {
910
var match = decodeURIComponent(window.location.hash).match(/^#!(.+)/);
10-
var name = match ? match[1] : '<%= url_for_main %>';
11+
var name = match ? match[1] : mainUrl;
1112
var url = new URL(name, location.href);
12-
window.top.location.replace(url.origin === location.origin ? name : '<%= url_for_main %>');
13+
window.top.location.replace(url.origin === location.origin ? name : mainUrl);
1314
} catch (e) {
14-
window.top.location.replace('<%= url_for_main %>');
15+
window.top.location.replace(mainUrl);
1516
}
1617
</script>
1718
<noscript>

0 commit comments

Comments
 (0)