Commit a11e798a authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Keep sidebars absolute until fixed at top; remove unneeded JS

parent eefbc2bf
......@@ -67,6 +67,7 @@
Build.prototype.initSidebar = function() {
this.$sidebar = $('.js-build-sidebar');
<<<<<<< 36beffc12461d2e479ad8b000b7ba5b6ea40cd33
this.sidebarTranslationLimits = {
<<<<<<< 3ee255139ab555ec49a177d3b2eed65580f36c4f
min: $('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight()
......@@ -80,9 +81,10 @@
this.$sidebar.css({
top: this.sidebarTranslationLimits.max
});
=======
>>>>>>> Keep sidebars absolute until fixed at top; remove unneeded JS
this.$sidebar.niceScroll();
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.location = function() {
......@@ -237,14 +239,6 @@
return bootstrapBreakpoint === 'xs' || bootstrapBreakpoint === 'sm';
};
Build.prototype.translateSidebar = function(e) {
var newPosition = this.sidebarTranslationLimits.max - (document.body.scrollTop || document.documentElement.scrollTop);
if (newPosition < this.sidebarTranslationLimits.min) newPosition = this.sidebarTranslationLimits.min;
this.$sidebar.css({
top: newPosition
});
};
Build.prototype.toggleSidebar = function(shouldHide) {
var shouldShow = typeof shouldHide === 'boolean' ? !shouldHide : undefined;
this.$buildScroll.toggleClass('sidebar-expanded', shouldShow)
......
......@@ -337,7 +337,7 @@ require('./flash');
.affix({
offset: {
top: () => (
$diffTabs.offset().top - $tabs.height() - $fixedNav.height() - $layoutNav.height()
$diffTabs.offset().top - $tabs.height()
),
},
})
......
......@@ -416,14 +416,20 @@
}
.page-with-layout-nav {
.right-sidebar {
top: ($header-height * 2) + 2;
}
.build-sidebar {
top: ($header-height * 3) + 3;
&.affix {
top: 0;
}
}
}
.activities {
.nav-block {
border-bottom: 1px solid $border-color;
......
......@@ -256,4 +256,9 @@ header.header-sidebar-pinned {
.right-sidebar {
border-left: 1px solid $border-color;
&.affix {
position: fixed;
top: 0;
}
}
......@@ -189,7 +189,8 @@
}
.right-sidebar {
position: fixed;
position: absolute;
height: 100%;
top: $header-height;
bottom: 0;
right: 0;
......
......@@ -479,7 +479,7 @@
background-color: $white-light;
&.affix {
top: 100px;
top: 0;
left: 0;
z-index: 10;
transition: right .15s;
......
......@@ -171,8 +171,6 @@
.tree-controls {
float: right;
margin-top: 11px;
position: relative;
z-index: 2;
.project-action-button {
margin-left: $btn-side-margin;
......
- builds = @build.pipeline.builds.to_a
%aside.right-sidebar.right-sidebar-expanded.build-sidebar.js-build-sidebar
%aside.right-sidebar.right-sidebar-expanded.build-sidebar.js-build-sidebar{ data: { "offset-top" => "151", "spy" => "affix" } }
.block.build-sidebar-header.visible-xs-block.visible-sm-block.append-bottom-default
Job
%strong ##{@build.id}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment