Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-01-25 21:25:43 +0300
committerJose Ivan Vargas <jvargas@gitlab.com>2017-01-25 21:25:43 +0300
commitffc5ec7d7723d429661d9f3e27a8be98a7976359 (patch)
tree83a03371904ef96bcdb05028e81a8c445604c6c9 /app/assets/javascripts/issuable_context.js
parentae65272bbf6f66162730f373bfa0236c67276c11 (diff)
Moved the turbolinks listener from application.js to the corresponding issuable sidebar file
Diffstat (limited to 'app/assets/javascripts/issuable_context.js')
-rw-r--r--app/assets/javascripts/issuable_context.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/issuable_context.js b/app/assets/javascripts/issuable_context.js
index 9c53cdee58e..c77fbb6a1c7 100644
--- a/app/assets/javascripts/issuable_context.js
+++ b/app/assets/javascripts/issuable_context.js
@@ -1,5 +1,7 @@
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-new, comma-dangle, quotes, prefer-arrow-callback, consistent-return, one-var, no-var, one-var-declaration-per-line, no-underscore-dangle, max-len */
/* global UsersSelect */
+/* global Cookies */
+/* global bp */
(function() {
this.IssuableContext = (function() {
@@ -37,6 +39,13 @@
}, 0);
}
});
+ window.addEventListener('beforeunload', function() {
+ // collapsed_gutter cookie hides the sidebar
+ var bpBreakpoint = bp.getBreakpointSize();
+ if (bpBreakpoint === 'xs' || bpBreakpoint === 'sm') {
+ Cookies.set('collapsed_gutter', true);
+ }
+ });
$(".right-sidebar").niceScroll();
}