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:
Marco Burstein
2018-07-16 11:19:21 -07:00
committed by Tim Abbott
parent 9149ac1cf4
commit a6939a5078

View File

@@ -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,