Skip to content

Commit

Permalink
Modal image fix
Browse files Browse the repository at this point in the history
  • Loading branch information
madprops committed Feb 12, 2025
1 parent 2263bcc commit dd971af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions public/static/assets/js/main/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ App.show_modal_image = (id = 0) => {
data = App.image_changed[App.image_changed.length - 1]
}

App.modal_image_resolution_applied = false
App.loaded_modal_image = data
let img = DOM.el(`#modal_image`)
DOM.hide(img)
Expand Down Expand Up @@ -451,6 +452,11 @@ App.apply_modal_image_resolution = (image, src) => {
return
}

if (App.modal_image_resolution_applied) {
return
}

App.modal_image_resolution_applied = true
let subheader = DOM.el(`#modal_image_subheader`)
let text = subheader.textContent
subheader.textContent = `${text} (${image.width} x ${image.height})`
Expand Down
1 change: 1 addition & 0 deletions public/static/assets/js/main/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ App.empty_message = `%[empty]%`
App.text_was_selected = false
App.highlight_regexes = []
App.max_reactions = 200
App.modal_image_resolution_applied = false

// Initial media-loading variables declarations
App.youtube_loading = false
Expand Down

0 comments on commit dd971af

Please sign in to comment.