summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2017-01-27 23:09:00 +0000
committerAlfredo Sumaran <alfredo@gitlab.com>2017-01-27 23:09:00 +0000
commit39a33eecd4bb4fed880850fe867b8434272e5346 (patch)
tree469d2ad1ee3cc7c0b843de18df3bff7b16690884 /app/assets
parentd2a2ba9381b3f3e11760434a2f963090ae071284 (diff)
parent1da62670656ea9f606cf27796fce76ed8291dff8 (diff)
downloadgitlab-ce-39a33eecd4bb4fed880850fe867b8434272e5346.tar.gz
Merge branch 'issuable-sidebar-bug' into 'master'
Fixed Issuable sidebar so it remains closed on mobile/smaller screen devices See merge request !7466
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/application.js9
-rw-r--r--app/assets/javascripts/issuable_context.js9
2 files changed, 9 insertions, 9 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index f0615481ed2..4849aab50f4 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -84,7 +84,6 @@
var $sidebarGutterToggle = $('.js-sidebar-toggle');
var $flash = $('.flash-container');
var bootstrapBreakpoint = bp.getBreakpointSize();
- var checkInitialSidebarSize;
var fitSidebarForSize;
// Set the default path for all cookies to GitLab's root directory
@@ -246,19 +245,11 @@
return $document.trigger('breakpoint:change', [bootstrapBreakpoint]);
}
};
- checkInitialSidebarSize = function () {
- bootstrapBreakpoint = bp.getBreakpointSize();
- if (bootstrapBreakpoint === 'xs' || 'sm') {
- return $document.trigger('breakpoint:change', [bootstrapBreakpoint]);
- }
- };
$window.off('resize.app').on('resize.app', function () {
return fitSidebarForSize();
});
gl.awardsHandler = new AwardsHandler();
- checkInitialSidebarSize();
new Aside();
-
// bind sidebar events
new gl.Sidebar();
});
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();
}