Skip to content

Node.js based forum software built for the modern web

fix: overflowing images on /world

Julian Lam438b4f6226f7
diff --git a/public/src/client/world.js b/public/src/client/world.js
index 5690c610bd..1318195060 100644
--- a/public/src/client/world.js
+++ b/public/src/client/world.js
@@ -19,7 +19,7 @@ define('forum/world', [
});
sort.handleSort('categoryTopicSort', 'world');
-
+ handleImages();
handleButtons();
handleHelp();
@@ -30,7 +30,6 @@ define('forum/world', [
socket.removeListener('event:new_post', onNewPost);
});
-
// Add label to sort
const sortLabelEl = document.getElementById('sort-label');
const sortOptionsEl = document.getElementById('sort-options');
@@ -76,6 +75,7 @@ define('forum/world', [
const listEl = document.getElementById('world-feed');
$(listEl).append(html);
html.find('.timeago').timeago();
+ handleImages();
callback();
});
});
@@ -204,6 +204,10 @@ define('forum/world', [
});
}
+ function handleImages() {
+ $('[component="post/content"] img:not(.not-responsive)').addClass('img-fluid');
+ }
+
function updateDropdowns(modified_cids, state) {
modified_cids.forEach(function (cid) {
const category = $('[data-cid="' + cid + '"]');
@@ -229,6 +233,7 @@ define('forum/world', [
}
feedEl.prepend(...html);
+ handleImages();
}
return World;