Skip to content

Commit

Permalink
FIX: Allow switching to/from masonry mode with loading slider (#33)
Browse files Browse the repository at this point in the history
Having a check for `displayMasonry` in the topic-list component `didInsertElement` hook is problematic because, under the loading slider, the topic-list component may be re-used across different routes. Instead, we can set up the resizeObserver unconditionally. It's cheap to set up, and it only has an effect on topic lists which actually have masonry mode enabled.
  • Loading branch information
davidtaylorhq committed Aug 4, 2023
1 parent 4f0fe85 commit a697701
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions javascripts/discourse/initializers/topic-thumbnails-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ export default {

didInsertElement() {
this._super();
if (!this.topicThumbnailsService.displayMasonry) {
return;
}
this.updateElementHeight();

if (window.ResizeObserver) {
Expand Down

0 comments on commit a697701

Please sign in to comment.