summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-09-08 15:50:44 +0100
committerPhil Hughes <me@iamphill.com>2017-09-08 15:50:44 +0100
commit500704e8dda55987275bf90a08dd13feb6c843e3 (patch)
tree448d06f7d6318d81dcf6507aad9d9d9f1b587c38
parentaf930b83a097f4ab83e6361bc3c210462e507cd9 (diff)
downloadgitlab-ce-new-sidebar-cookie-fix.tar.gz
Fixes the sidebar_collapsed resettingnew-sidebar-cookie-fix
This was caused by visiting a page that didn't not have a sidebar but the code would still run through the render code. The render code would then see no sidebar, presume its collapsed & set the cookie to false.
-rw-r--r--app/assets/javascripts/new_sidebar.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/new_sidebar.js b/app/assets/javascripts/new_sidebar.js
index 709a5d33b9f..1298ac171ba 100644
--- a/app/assets/javascripts/new_sidebar.js
+++ b/app/assets/javascripts/new_sidebar.js
@@ -5,7 +5,10 @@ import bp from './breakpoints';
export default class NewNavSidebar {
constructor() {
this.initDomElements();
- this.render();
+
+ if (this.$sidebar.length) {
+ this.render();
+ }
}
initDomElements() {