diff options
author | Phil Hughes <me@iamphill.com> | 2017-09-08 15:50:44 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-09-08 15:50:44 +0100 |
commit | 500704e8dda55987275bf90a08dd13feb6c843e3 (patch) | |
tree | 448d06f7d6318d81dcf6507aad9d9d9f1b587c38 | |
parent | af930b83a097f4ab83e6361bc3c210462e507cd9 (diff) | |
download | gitlab-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.js | 5 |
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() { |