Skip to content

Commit

Permalink
Update Gumshoe to v5.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mmistakes authored and chukycheese committed Sep 18, 2023
1 parent 6c978c5 commit 3872021
Show file tree
Hide file tree
Showing 4 changed files with 10,378 additions and 15 deletions.
7 changes: 2 additions & 5 deletions assets/js/main.min.js

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions assets/js/plugins/gumshoe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* gumshoejs v5.1.0
* gumshoejs v5.1.1
* A simple, framework-agnostic scrollspy script.
* (c) 2019 Chris Ferdinandi
* MIT License
Expand Down Expand Up @@ -108,12 +108,14 @@
* @param {Array} contents The content areas
*/
var sortContents = function (contents) {
contents.sort((function (item1, item2) {
var offset1 = getOffsetTop(item1.content);
var offset2 = getOffsetTop(item2.content);
if (offset1 < offset2) return -1;
return 1;
}));
if(contents) {
contents.sort((function (item1, item2) {
var offset1 = getOffsetTop(item1.content);
var offset2 = getOffsetTop(item2.content);
if (offset1 < offset2) return -1;
return 1;
}));
}
};

/**
Expand Down Expand Up @@ -409,7 +411,7 @@

// Setup debounce callback
timeout = window.requestAnimationFrame((function () {
sortContents();
sortContents(contents);
publicAPIs.detect();
}));

Expand All @@ -422,7 +424,7 @@

// Undo DOM changes
if (current) {
deactivate(current);
deactivate(current, settings);
}

// Remove event listeners
Expand Down
Loading

0 comments on commit 3872021

Please sign in to comment.