mirror of
https://github.com/vinta/awesome-python.git
synced 2026-11-20 06:40:51 +00:00
fix(website): open entry anchors after restoring filters
This commit is contained in:
parent
21d57daf1c
commit
ee9dfa0d8e
2 changed files with 68 additions and 5 deletions
|
|
@ -361,11 +361,6 @@ document.addEventListener("click", function (e) {
|
|||
gtag("event", "sponsor_contact", { tier: link.dataset.tier });
|
||||
});
|
||||
|
||||
if (location.hash) {
|
||||
const linkedRow = document.getElementById(decodeURIComponent(location.hash.slice(1)));
|
||||
if (linkedRow && linkedRow.matches("tr.row")) openEntryRow(linkedRow);
|
||||
}
|
||||
|
||||
if (searchInput) {
|
||||
let searchTimer;
|
||||
searchInput.addEventListener("input", function () {
|
||||
|
|
@ -451,4 +446,9 @@ if (backToTop) {
|
|||
sortRows();
|
||||
}
|
||||
updateSortIndicators();
|
||||
// Filtering collapses rows, so open a linked entry after restoring URL state.
|
||||
if (location.hash) {
|
||||
const linkedRow = document.getElementById(decodeURIComponent(location.hash.slice(1)));
|
||||
if (linkedRow && linkedRow.matches("tr.row")) openEntryRow(linkedRow);
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue