Skip to content

Commit 34a4670

Browse files
committed
Show image placeholder
1 parent 4b5f983 commit 34a4670

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/js/repo.js

+6-11
Original file line numberDiff line numberDiff line change
@@ -1281,22 +1281,17 @@ class Repository {
12811281
// Relative to current file showing
12821282
href = href.replace("./", "");
12831283
href = root ? root + "/" + href : href;
1284-
if(window.branch) {
1285-
href = "/1GitLiXB6t5r8vuU2zC6a8GYj9ME6HMQ4t/repo/file/?" + address + "/" + href + "@" + branch;
1286-
} else {
1287-
href = "/1GitLiXB6t5r8vuU2zC6a8GYj9ME6HMQ4t/repo/file/?" + address + "/" + href + "@";
1288-
}
12891284
} else if(href[0] == "/") {
12901285
// Relative to repository root
12911286
href = href.replace("/", "");
1292-
if(window.branch) {
1293-
href = "/1GitLiXB6t5r8vuU2zC6a8GYj9ME6HMQ4t/repo/file/?" + address + "/" + href + "@" + branch;
1294-
} else {
1295-
href = "/1GitLiXB6t5r8vuU2zC6a8GYj9ME6HMQ4t/repo/file/?" + address + "/" + href + "@";
1296-
}
1287+
} else {
1288+
return this.__proto__.image.call(this, href, title, text); // super() analog
12971289
}
12981290

1299-
return this.__proto__.image.call(this, href, title, text); // super() analog
1291+
let node = document.createElement("div");
1292+
node.className = "image-placeholder";
1293+
node.textContent = "Loading " + (title || href);
1294+
return node.outerHTML;
13001295
};
13011296
renderer.text = function(text) {
13021297
return text

0 commit comments

Comments
 (0)