summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2016-09-02 20:23:35 -0500
committerMike Greiling <mike@pixelcog.com>2016-09-07 14:02:21 -0500
commit9b8ee45c87588c16337d2b1c3cff1fc52aec1571 (patch)
tree994131d0f37ad8744f17c0aee9e6d25b9a4a20a3
parent32c53d6d1b71885acbcab7829e197744a357c9fc (diff)
downloadgitlab-ce-19183-refactor-sidebar-js.tar.gz
sync sidebar DOM state on page:change to minimize split-second appearance of the sidebar in certain situations19183-refactor-sidebar-js
-rw-r--r--app/assets/javascripts/sidebar.js.es65
1 files changed, 2 insertions, 3 deletions
diff --git a/app/assets/javascripts/sidebar.js.es6 b/app/assets/javascripts/sidebar.js.es6
index 0cd6f946f61..755fac8107b 100644
--- a/app/assets/javascripts/sidebar.js.es6
+++ b/app/assets/javascripts/sidebar.js.es6
@@ -23,8 +23,6 @@
if (!singleton) {
singleton = this;
singleton.init();
- } else {
- singleton.renderState();
}
return singleton;
}
@@ -38,7 +36,8 @@
$(document)
.on('click', sidebarToggleSelector, () => this.toggleSidebar())
.on('click', pinnedToggleSelector, () => this.togglePinnedState())
- .on('click', 'html, body', (e) => this.handleClickEvent(e));
+ .on('click', 'html, body', (e) => this.handleClickEvent(e))
+ .on('page:change', () => this.renderState());
this.renderState();
}