mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 12:03:11 +00:00
Fix next/prev buttons in media viewer
This commit is contained in:
parent
00b84d31f5
commit
99cda335ab
1 changed files with 4 additions and 4 deletions
|
@ -48,22 +48,22 @@ function openImageViewer(link, {pushState = true} = {}) {
|
|||
|
||||
// Previous image
|
||||
let previousImage = link.closest(".preview").prev(".preview")
|
||||
.find(".toggle-content.show .toggle-thumbnail").last();
|
||||
.find(".toggle-content .toggle-thumbnail").last();
|
||||
|
||||
if (!previousImage.length) {
|
||||
previousImage = link.closest(".msg").prevAll()
|
||||
.find(".toggle-content.show .toggle-thumbnail").last();
|
||||
.find(".toggle-content .toggle-thumbnail").last();
|
||||
}
|
||||
|
||||
previousImage.addClass("previous-image");
|
||||
|
||||
// Next image
|
||||
let nextImage = link.closest(".preview").next(".preview")
|
||||
.find(".toggle-content.show .toggle-thumbnail").first();
|
||||
.find(".toggle-content .toggle-thumbnail").first();
|
||||
|
||||
if (!nextImage.length) {
|
||||
nextImage = link.closest(".msg").nextAll()
|
||||
.find(".toggle-content.show .toggle-thumbnail").first();
|
||||
.find(".toggle-content .toggle-thumbnail").first();
|
||||
}
|
||||
|
||||
nextImage.addClass("next-image");
|
||||
|
|
Loading…
Reference in a new issue