summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-10-14 21:25:45 +0000
committerFatih Acet <acetfatih@gmail.com>2016-10-14 21:25:45 +0000
commit2ebc63dd3ce08ff35bf89d39e1906ce1cf828b3a (patch)
tree81f501be6463bf61d565c76754132750bbbd4796 /app/assets
parent9a7ceafee693b48917df9d008d6ad62ef6e2b853 (diff)
parent680efd4f8d6fb3a1036edc135f5761a512f8eea7 (diff)
downloadgitlab-ce-2ebc63dd3ce08ff35bf89d39e1906ce1cf828b3a.tar.gz
Merge branch '18844-missing-subnavs-on-some-pages' into 'master'
Added subnav to all views bar issuable views ## What does this MR do? Adds subnav to all views apart from issue and MR views. The full list is available in screenshots below. It also adds some JS to the builds page to simply handle the repositioning of the fixed position sidebar with the addition of the subnav. ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? ~UX and apparently ~regression . ## What are the relevant issue numbers? Closes #18844. ## Screenshots (if relevant) ### Label #### Edit ![Screen_Shot_2016-08-24_at_23.45.25](/uploads/3e5ded9e60f0eccc37672ab0a1423bfb/Screen_Shot_2016-08-24_at_23.45.25.png) #### New ![Screen_Shot_2016-08-24_at_23.45.13](/uploads/767c6e97c91a5ded904f5b495950f5a8/Screen_Shot_2016-08-24_at_23.45.13.png) ### Milestone #### Edit ![Screen_Shot_2016-08-24_at_23.45.37](/uploads/27562162415a6ae403e7117df009b208/Screen_Shot_2016-08-24_at_23.45.37.png) #### New ![Screen_Shot_2016-08-24_at_23.45.43](/uploads/43c655b0a2af9a8da335a2efc31cb2df/Screen_Shot_2016-08-24_at_23.45.43.png) #### Show ![Screen_Shot_2016-08-24_at_23.45.53](/uploads/68c3e0788c81f5897c7db11bb2b02a4c/Screen_Shot_2016-08-24_at_23.45.53.png) ### Commit #### Show ![Screen_Shot_2016-08-26_at_14.15.20](/uploads/9f96e0587e4866fa95e28c224a185844/Screen_Shot_2016-08-26_at_14.15.20.png) #### Builds ![Screen_Shot_2016-08-26_at_15.28.46](/uploads/9f0d8ababc8362874a3e2b5d877c7668/Screen_Shot_2016-08-26_at_15.28.46.png) ### Blob #### Blame ![Screen_Shot_2016-08-26_at_14.18.03](/uploads/2999f2cd304e3b9be6530a52407eca59/Screen_Shot_2016-08-26_at_14.18.03.png) #### Edit ![Screen_Shot_2016-08-26_at_14.20.32](/uploads/bb7b00bbe835228a8ec8b371e9364cb8/Screen_Shot_2016-08-26_at_14.20.32.png) ### Pipelines #### Show ![Screen_Shot_2016-08-26_at_15.44.30](/uploads/ee84c51597ab04a07a6c953704280e7b/Screen_Shot_2016-08-26_at_15.44.30.png) #### Show build ![Screen_Shot_2016-08-26_at_15.45.55](/uploads/dd78ef3dc083186095cdc84f41c80b21/Screen_Shot_2016-08-26_at_15.45.55.png) #### Edit Envrionment ![Screen_Shot_2016-08-26_at_15.48.33](/uploads/4e9340e11eedeaeddebb708f02db3598/Screen_Shot_2016-08-26_at_15.48.33.png) ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) Closes #18844 See merge request !5998
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/build.js36
-rw-r--r--app/assets/stylesheets/pages/builds.scss6
2 files changed, 35 insertions, 7 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js
index f336bfc36d6..97462a5959c 100644
--- a/app/assets/javascripts/build.js
+++ b/app/assets/javascripts/build.js
@@ -15,18 +15,17 @@
this.hideSidebar = bind(this.hideSidebar, this);
this.toggleSidebar = bind(this.toggleSidebar, this);
this.updateDropdown = bind(this.updateDropdown, this);
+ this.$document = $(document);
clearInterval(Build.interval);
// Init breakpoint checker
this.bp = Breakpoints.get();
- $('.js-build-sidebar').niceScroll();
+ this.initSidebar();
this.populateJobs(this.build_stage);
this.updateStageDropdownText(this.build_stage);
- this.hideSidebar();
- $(document).off('click', '.js-sidebar-build-toggle').on('click', '.js-sidebar-build-toggle', this.toggleSidebar);
$(window).off('resize.build').on('resize.build', this.hideSidebar);
- $(document).off('click', '.stage-item').on('click', '.stage-item', this.updateDropdown);
+ this.$document.off('click', '.stage-item').on('click', '.stage-item', this.updateDropdown);
$('#js-build-scroll > a').off('click').on('click', this.stepTrace);
this.updateArtifactRemoveDate();
if ($('#build-trace').length) {
@@ -62,6 +61,21 @@
}
}
+ Build.prototype.initSidebar = function() {
+ this.$sidebar = $('.js-build-sidebar');
+ this.sidebarTranslationLimits = {
+ min: $('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight()
+ }
+ this.sidebarTranslationLimits.max = this.sidebarTranslationLimits.min + $('.scrolling-tabs-container').outerHeight();
+ this.$sidebar.css({
+ top: this.sidebarTranslationLimits.max
+ });
+ this.$sidebar.niceScroll();
+ this.hideSidebar();
+ this.$document.off('click', '.js-sidebar-build-toggle').on('click', '.js-sidebar-build-toggle', this.toggleSidebar);
+ this.$document.off('scroll.translateSidebar').on('scroll.translateSidebar', this.translateSidebar.bind(this));
+ };
+
Build.prototype.getInitialBuildTrace = function() {
var removeRefreshStatuses = ['success', 'failed', 'canceled', 'skipped']
@@ -129,15 +143,23 @@
Build.prototype.toggleSidebar = function() {
if (this.shouldHideSidebar()) {
- return $('.js-build-sidebar').toggleClass('right-sidebar-expanded right-sidebar-collapsed');
+ return this.$sidebar.toggleClass('right-sidebar-expanded right-sidebar-collapsed');
}
};
+ Build.prototype.translateSidebar = function(e) {
+ var newPosition = this.sidebarTranslationLimits.max - document.body.scrollTop;
+ if (newPosition < this.sidebarTranslationLimits.min) newPosition = this.sidebarTranslationLimits.min;
+ this.$sidebar.css({
+ top: newPosition
+ });
+ };
+
Build.prototype.hideSidebar = function() {
if (this.shouldHideSidebar()) {
- return $('.js-build-sidebar').removeClass('right-sidebar-expanded').addClass('right-sidebar-collapsed');
+ return this.$sidebar.removeClass('right-sidebar-expanded').addClass('right-sidebar-collapsed');
} else {
- return $('.js-build-sidebar').removeClass('right-sidebar-collapsed').addClass('right-sidebar-expanded');
+ return this.$sidebar.removeClass('right-sidebar-collapsed').addClass('right-sidebar-expanded');
}
};
diff --git a/app/assets/stylesheets/pages/builds.scss b/app/assets/stylesheets/pages/builds.scss
index 194a39a8377..fcaba954615 100644
--- a/app/assets/stylesheets/pages/builds.scss
+++ b/app/assets/stylesheets/pages/builds.scss
@@ -233,3 +233,9 @@
right: 0;
margin-top: -17px;
}
+
+@media (min-width: $screen-md-min) {
+ .sub-nav.build {
+ width: calc(100% + #{$gutter_width});
+ }
+}