Skip to content

Commit ce0a803

Browse files
committed
docs: fixed loading of templates: use relative paths
1 parent 7852810 commit ce0a803

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010

1111
<script>
1212
derby.App.prototype.getTemplate = function(filename) {
13-
console.warn("get template", filename)
14-
1513
var el = document.getElementById(filename);
1614
if (el) return el;
1715

1816
var result = undefined;
1917

18+
if (filename[0] === '/')
19+
filename = '.' + filename;
20+
2021
$.ajax({
2122
method: 'GET',
2223
url: filename,
@@ -38,7 +39,7 @@
3839
</head>
3940

4041
<body>
41-
<script id="/select2-demo.html" type="text/template">
42+
<script id="select2-demo.html" type="text/template">
4243
<Body:>
4344
<div class="container">
4445
<h1>Derby Select2 Demo</h1>
@@ -120,7 +121,7 @@ <h4>Bootstrap</h4>
120121
var app = derby.createApp()
121122

122123
// Load templates from id
123-
app.loadViews('/select2-demo.html')
124+
app.loadViews('select2-demo.html')
124125
app.component(Select2.Select2)
125126

126127
// create the page

0 commit comments

Comments
 (0)