Skip to content

Commit 1d032b3

Browse files
committed
Bug Fix: Uploaded images not found by select all button or word cloud filter until page reload
The js function adding new uploads to the image picker wasn't setting the option value properly
1 parent 8cb4717 commit 1d032b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

static/webapp.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
// Adds a new image to the image picker from the given return json of an upload
44
function add_thumbnails(data) {
5-
key_list = get_keys()
5+
var key_list = get_keys();
66
for (var i = 0; i < data.length; i++) {
77
file_data = data[i];
88
if (key_list.includes(file_data["file_name"]) == false) {
99
$('#thumbnails select').prepend($("<option></option>")
1010
.attr("data-img-src", file_data["file_name"])
1111
.attr("data-img-label", file_data["caption"])
1212
.attr("data-img-alt", file_data["caption"])
13+
.attr("value", file_data["file_name"])
1314
.text(file_data["caption"]));
1415
}
1516
}
@@ -205,6 +206,6 @@ $(function() {
205206
$("#file-input").val("");
206207
}
207208
})
208-
})
209+
});
209210

210211
});

0 commit comments

Comments
 (0)