Skip to content

Commit

Permalink
Move images with maps to top of page
Browse files Browse the repository at this point in the history
  • Loading branch information
mwenge committed Oct 4, 2020
1 parent 662721b commit 87d4158
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,15 @@ function shuffleImagesToFront(array) {
return array;
}
const hasImage = function(x) { return inscriptions.get(x).facsimileImages.length > 0; }
let a1 = shuffle(array.filter((v, i, a) => hasImage(v)));
const hasLetterMaps = function(x) {
var imgs = inscriptions.get(x).facsimileImages;
if (!imgs.length) {
return false;
}
return imgs.some(v => coordinates.has(v));
}
let a1 = shuffle(array.filter((v, i, a) => hasLetterMaps(v)));
a1 = a1.concat(shuffle(array.filter((v, i, a) => hasImage(v))));
a1 = a1.concat(shuffle(array.filter((v, i, a) => !hasImage(v))));

return a1;
Expand Down
Binary file modified images/photos/Kn676.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 87d4158

Please sign in to comment.