Skip to content

Commit

Permalink
Add back the image_number version
Browse files Browse the repository at this point in the history
  • Loading branch information
kc0bfv committed Nov 11, 2021
1 parent 8e85d32 commit 9de0a45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,12 @@
// If it is, and it's really a gallery_item then click on it
let click_hash = function () {
let fid = $(window.location.hash);
if( fid.length == 1 && fid[0].classList.contains("gallery-item") ) {
if( fid.length == 1 &&
(
fid[0].classList.contains("gallery-item") ||
fid[0].classList.contains("gallery-item-marker")
)
) {
let curr_item = $.magnificPopup.instance.currItem;
if( curr_item &&
curr_item.el.attr("id") == fid[0].id )
Expand Down
1 change: 1 addition & 0 deletions layouts/partials/sect_and_img_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ <h2>{{ .title }}</h2>
downloadable="{{ cond $downloadable "true" "false" }}"
orig_name="{{ $filename }}"
href="{{ .full.RelPermalink }}">
<div id="image_number_{{ .index }}" class="gallery-item-marker"></div>
<img src="{{ .thumb.RelPermalink }}"
{{ with .alt }} alt="{{ . }}"{{ end }}>
</a>
Expand Down

1 comment on commit 9de0a45

@githubmonkey
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change might use the wrong values in .index.

The variable index is passed in from list.html. There it is set when iterating over the resources, but BEFORE those are sorted by weight. As a result, the thumbs are displayed ordered by weight but the full size sequence order is alphabetical.

Please sign in to comment.