Now anchors to the top or bottom of the build trace with the correct offset
This commit is contained in:
parent
b5d74bef8e
commit
f162dde69f
|
@ -27,7 +27,7 @@
|
||||||
$(document).off('click', '.js-sidebar-build-toggle').on('click', '.js-sidebar-build-toggle', this.toggleSidebar);
|
$(document).off('click', '.js-sidebar-build-toggle').on('click', '.js-sidebar-build-toggle', this.toggleSidebar);
|
||||||
$(window).off('resize.build').on('resize.build', this.hideSidebar);
|
$(window).off('resize.build').on('resize.build', this.hideSidebar);
|
||||||
$(document).off('click', '.stage-item').on('click', '.stage-item', this.updateDropdown);
|
$(document).off('click', '.stage-item').on('click', '.stage-item', this.updateDropdown);
|
||||||
$('.step-up-trace, .step-down-trace').off('click').on('click', this.stepTrace);
|
$('#js-build-scroll > a').off('click').on('click', this.stepTrace);
|
||||||
this.updateArtifactRemoveDate();
|
this.updateArtifactRemoveDate();
|
||||||
if ($('#build-trace').length) {
|
if ($('#build-trace').length) {
|
||||||
this.getInitialBuildTrace();
|
this.getInitialBuildTrace();
|
||||||
|
@ -167,11 +167,11 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
Build.prototype.stepTrace = function(e) {
|
Build.prototype.stepTrace = function(e) {
|
||||||
if ($(e.currentTarget).hasClass('step-up-trace')) {
|
e.preventDefault();
|
||||||
$.scrollTo('-=50px');
|
$currentTarget = $(e.currentTarget);
|
||||||
} else {
|
$.scrollTo($currentTarget.attr('href'), {
|
||||||
$.scrollTo('+=50px');
|
offset: -($('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight())
|
||||||
}
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return Build;
|
return Build;
|
||||||
|
|
|
@ -34,9 +34,9 @@
|
||||||
Build has been erased #{erased_by.html_safe} #{time_ago_with_tooltip(@build.erased_at)}
|
Build has been erased #{erased_by.html_safe} #{time_ago_with_tooltip(@build.erased_at)}
|
||||||
- else
|
- else
|
||||||
#js-build-scroll.scroll-controls
|
#js-build-scroll.scroll-controls
|
||||||
%a.step-up-trace.btn
|
= link_to '#build-trace', class: 'btn' do
|
||||||
%i.fa.fa-angle-up
|
%i.fa.fa-angle-up
|
||||||
%a.step-down-trace.btn
|
= link_to '#down-build-trace', class: 'btn' do
|
||||||
%i.fa.fa-angle-down
|
%i.fa.fa-angle-down
|
||||||
%pre.build-trace#build-trace
|
%pre.build-trace#build-trace
|
||||||
%code.bash.js-build-output
|
%code.bash.js-build-output
|
||||||
|
|
Loading…
Reference in New Issue