fix: update navigator when sidebar is toggled

This commit is contained in:
Barış Soner Uşaklı 2023-01-19 23:14:12 -05:00
parent 76e7552d95
commit 3daf4e84fa

View file

@ -37,7 +37,7 @@ $(document).ready(function () {
});

function setupMobileMenu() {
require(['api'], function (api) {
require(['hooks', 'api', 'navigator'], function (hooks, api, navigator) {
$('[component="sidebar/toggle"]').on('click', async function () {
const sidebarEl = $('.sidebar');
sidebarEl.toggleClass('open');
@ -49,6 +49,9 @@ $(document).ready(function () {
});
}
$(window).trigger('action:sidebar.toggle');
if (ajaxify.data.template.topic) {
hooks.fire('action:navigator.update', { newIndex: navigator.getIndex() });
}
});
});
}