summaryrefslogtreecommitdiffstats
path: root/theme/javascript/sidebar.js
diff options
context:
space:
mode:
Diffstat (limited to 'theme/javascript/sidebar.js')
-rw-r--r--theme/javascript/sidebar.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/theme/javascript/sidebar.js b/theme/javascript/sidebar.js
index d381822..9fc1e8e 100644
--- a/theme/javascript/sidebar.js
+++ b/theme/javascript/sidebar.js
@@ -25,9 +25,14 @@ function isOpen() {
// Prepare sidebar: state and toggle button
function init() {
// Init last state if not mobile
- if (!platform.isMobile) {
+ if (!platform.isMobile()) {
toggleSidebar(storage.get('sidebar', true), false);
}
+
+ // Close sidebar after clicking a link on mobile
+ $(document).on('click', '.book-summary li.chapter a', function(e) {
+ if (platform.isMobile()) toggleSidebar(false, false);
+ });
}
// Filter summary with a list of path