aboutsummaryrefslogtreecommitdiff
path: root/static/scripts
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-07-18 14:18:39 +0530
committerBobby <[email protected]>2025-07-18 14:18:39 +0530
commit821773b12c07a4bc23628e7d98ac4b34da1eb9e1 (patch)
treec37711d86bd893a9bc5a829653890ee75c29ee09 /static/scripts
parent01e730c68a79862112798d4816625ddcd00350d9 (diff)
downloadimageboard-821773b12c07a4bc23628e7d98ac4b34da1eb9e1.tar.xz
imageboard-821773b12c07a4bc23628e7d98ac4b34da1eb9e1.zip
template filters and image resizer
Diffstat (limited to 'static/scripts')
-rw-r--r--static/scripts/resize.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/static/scripts/resize.js b/static/scripts/resize.js
index 95b75c1..10ea02e 100644
--- a/static/scripts/resize.js
+++ b/static/scripts/resize.js
@@ -27,7 +27,6 @@ function handleResize() {
function switchSize(size) {
currentSize = size
const img = document.getElementById('post-image')
- const container = document.querySelector('.post-image-container')
const sizeData = sizes[size]
img.className = ''
@@ -69,12 +68,10 @@ function switchSize(size) {
img.classList.add('fixed-size')
}
- img.src = sizeData.src
+ if (img.src !== sizeData.src) {
+ img.src = sizeData.src
+ }
updateSizeSelection(size)
}
-window.addEventListener('resize', handleResize)
-
-window.addEventListener('load', function () {
- switchSize(currentSize)
-}) \ No newline at end of file
+window.addEventListener('resize', handleResize) \ No newline at end of file