mirror of
https://hk.gh-proxy.com/https://github.com/NodeBB/nodebb-theme-harmony.git
synced 2025-10-03 05:01:05 +08:00
fix: update navigator when sidebar is toggled
This commit is contained in:
parent
76e7552d95
commit
3daf4e84fa
1 changed files with 4 additions and 1 deletions
|
@ -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() });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue