Skip to content

Commit 6554f5d

Browse files
committed
Testing possible fix for missing relative/baseURL when clicking img
1 parent a7eccaa commit 6554f5d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

static/js/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,10 @@ document.addEventListener('click', function(e) {
194194
!e.target.classList.contains('image-card-img') &&
195195
!e.target.src.includes('#no-click')) {
196196

197-
// Open image in same tab, just like clicking a regular link
198-
window.location.href = e.target.src
197+
// Open image in same tab, similar to image shortcode
198+
// Create a temporary anchor element to resolve the relative URL properly
199+
const tempAnchor = document.createElement('a')
200+
tempAnchor.href = e.target.getAttribute('src')
201+
window.location.href = tempAnchor.href
199202
}
200203
})

0 commit comments

Comments
 (0)