Commit bec6ea20 authored by Phil Hughes's avatar Phil Hughes

fixed breadcrumbs being undefined

parent dae629e5
......@@ -8,14 +8,17 @@ export const addTooltipToEl = (el) => {
export default () => {
const breadcrumbs = document.querySelector('.breadcrumbs-list');
const topLevelLinks = breadcrumbs.querySelectorAll('.breadcrumbs-list > li > a');
const $expander = $('.js-breadcrumbs-collapsed-expander');
topLevelLinks.forEach(el => addTooltipToEl(el));
if (breadcrumbs) {
const topLevelLinks = breadcrumbs.querySelectorAll('.breadcrumbs-list > li > a');
const $expander = $('.js-breadcrumbs-collapsed-expander');
$expander.closest('.dropdown')
.on('show.bs.dropdown hide.bs.dropdown', (e) => {
$('.js-breadcrumbs-collapsed-expander', e.currentTarget).toggleClass('open')
.tooltip('hide');
});
topLevelLinks.forEach(el => addTooltipToEl(el));
$expander.closest('.dropdown')
.on('show.bs.dropdown hide.bs.dropdown', (e) => {
$('.js-breadcrumbs-collapsed-expander', e.currentTarget).toggleClass('open')
.tooltip('hide');
});
}
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment