diff options
Diffstat (limited to 'app/assets/javascripts/sidebar.js.es6')
-rw-r--r-- | app/assets/javascripts/sidebar.js.es6 | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/app/assets/javascripts/sidebar.js.es6 b/app/assets/javascripts/sidebar.js.es6 index ead3219bc31..755fac8107b 100644 --- a/app/assets/javascripts/sidebar.js.es6 +++ b/app/assets/javascripts/sidebar.js.es6 @@ -34,8 +34,8 @@ $(pageSelector).hasClass(expandedPageClass) ); $(document) - .on('click', sidebarToggleSelector, (e) => this.toggleSidebar(e)) - .on('click', pinnedToggleSelector, (e) => this.togglePinnedState(e)) + .on('click', sidebarToggleSelector, () => this.toggleSidebar()) + .on('click', pinnedToggleSelector, () => this.togglePinnedState()) .on('click', 'html, body', (e) => this.handleClickEvent(e)) .on('page:change', () => this.renderState()); this.renderState(); @@ -47,19 +47,17 @@ const targetIsToggle = $target.closest(sidebarToggleSelector).length > 0; const targetIsSidebar = $target.closest(sidebarWrapperSelector).length > 0; if (!targetIsToggle && (!targetIsSidebar || $target.closest('a'))) { - this.toggleSidebar(e); + this.toggleSidebar(); } } } - toggleSidebar(e) { - e.preventDefault(); + toggleSidebar() { this.isExpanded = !this.isExpanded; this.renderState(); } - togglePinnedState(e) { - e.preventDefault(); + togglePinnedState() { this.isPinned = !this.isPinned; if (!this.isPinned) { this.isExpanded = false; |