mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
lightbox: Fix lightbox not showing new thumbnails as selected.
The current code for detecting which image to add the `selected` class to is `preview_source.match(src)`. With the new thumbnails, this no longer works because thumbnail URLs include a `?`, which has its own RegEx significance. To solve this, check for equality instead of using RegExes.
This commit is contained in:
committed by
Tim Abbott
parent
9149ac1cf4
commit
a6939a5078
@@ -15,7 +15,7 @@ function render_lightbox_list_images(preview_source) {
|
||||
|
||||
images.forEach(function (img) {
|
||||
var src = img.getAttribute("src");
|
||||
var className = preview_source.match(src) ? "image selected" : "image";
|
||||
var className = preview_source === src ? "image selected" : "image";
|
||||
|
||||
var node = $("<div></div>", {
|
||||
class: className,
|
||||
|
||||
Reference in New Issue
Block a user