Skip to content

Commit

Permalink
Exposing the UNav Config for consumers to modify and reload the UNav …
Browse files Browse the repository at this point in the history
…if needed (#2501)

* exporting the unav config to be consumed and modified later by consumers

* Adding a comment to explain why we need this

* Updating comment

* getting the Unav config from the object before reloading
  • Loading branch information
amol-anand authored Jul 8, 2024
1 parent daef70b commit 14af634
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,12 @@ class Gnav {
children: getChildren(),
});

window.UniversalNav(getConfiguration());
// Exposing UNAV config for consumers
CONFIG.universalNav.universalNavConfig = getConfiguration();
window.UniversalNav(CONFIG.universalNav.universalNavConfig);

isDesktop.addEventListener('change', () => {
window.UniversalNav.reload(getConfiguration());
window.UniversalNav.reload(CONFIG.universalNav.universalNavConfig);
});
};

Expand Down

0 comments on commit 14af634

Please sign in to comment.