Skip to content

Commit

Permalink
Correctly interpret old lab links
Browse files Browse the repository at this point in the history
  • Loading branch information
ineiti committed Mar 19, 2024
1 parent e8015e9 commit 9b01ed6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions views/projects.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,14 @@
// Sets the dropdown-boxes and the search box given a URL-hash string.
// If the string is invalid, it will reset it to be empty.
function search_for_query(str){
let search = new URLSearchParams(str);
let dropdown = search.get("dropdown")?.split(" ") ?? [];
const search = new URLSearchParams(str);
const dropdown = (search.get("dropdown")?.split(" ") ?? []).map((s) => {
// Make old links compatible with new "_" at the end of lab names
if (s.startsWith("lab_") && !s.endsWith("_")){
return `${s}_`;
}
return s;
});
["work", "categories", "applications", "lab"].forEach(id => {
let select = $(`#${id}`)[0];
Expand Down

0 comments on commit 9b01ed6

Please sign in to comment.