Skip to content

Commit 8ff93f8

Browse files
Update misc.js
1 parent 4d1a7ef commit 8ff93f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

static/misc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ function fillEntirePage() {
3939

4040
(function () {
4141
// Images click
42-
for (var image of document.querySelectorAll("img")) {
42+
for (var image of document.querySelectorAll("img[src]")) {
4343
var a = document.createElement("a");
4444
a.setAttribute("target", "_blank");
4545
a.setAttribute("href", image.getAttribute("src"));
46-
image.replaceWith(a);
46+
image.parentNode.insertBefore(a, image);
4747
a.append(image);
4848
}
4949
})();

0 commit comments

Comments
 (0)