Skip to content

Commit

Permalink
EWPP-2422: Fix inpage navigation containers not looking for sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
imanoleguskiza committed Jul 15, 2022
1 parent 22f42a7 commit 554713b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/inpage_navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@
});
});

// The container might define its own selector so loop through those elements as well.
if (container.hasAttribute('data-inpage-navigation-source-area')) {
let selectors = container.getAttribute('data-inpage-navigation-source-area');
Array.prototype.forEach.call(container.querySelectorAll(':scope ' + selectors), function (element) {
element.setAttribute('data-inpage-navigation-source-element', '');
});
}

let items_markup = '';
// Collect all the elements marked as source. Now the elements will be unique and ordered correctly.
Array.prototype.forEach.call(container.querySelectorAll(':scope [data-inpage-navigation-source-element]'), function (element) {
Expand Down

0 comments on commit 554713b

Please sign in to comment.