summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2016-09-09 20:01:48 +0100
committerLuke Bennett <lukeeeebennettplus@gmail.com>2016-09-09 21:22:18 +0100
commitf162dde69f339895d8cea44af3670fe197fe2414 (patch)
tree9d8d65f2858ac817c9adb02b02d5d5b3a6fbcc48
parentb5d74bef8e3ccd18072267cc660ccdcbfd65eebf (diff)
downloadgitlab-ce-fix-build-trace-anchors.tar.gz
Now anchors to the top or bottom of the build trace with the correct offsetfix-build-trace-anchors
-rw-r--r--app/assets/javascripts/build.js12
-rw-r--r--app/views/projects/builds/show.html.haml4
2 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js
index 35c0c17d666..78d21c0552a 100644
--- a/app/assets/javascripts/build.js
+++ b/app/assets/javascripts/build.js
@@ -27,7 +27,7 @@
$(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);
- $('.step-up-trace, .step-down-trace').off('click').on('click', this.stepTrace);
+ $('#js-build-scroll > a').off('click').on('click', this.stepTrace);
this.updateArtifactRemoveDate();
if ($('#build-trace').length) {
this.getInitialBuildTrace();
@@ -167,11 +167,11 @@
};
Build.prototype.stepTrace = function(e) {
- if ($(e.currentTarget).hasClass('step-up-trace')) {
- $.scrollTo('-=50px');
- } else {
- $.scrollTo('+=50px');
- }
+ e.preventDefault();
+ $currentTarget = $(e.currentTarget);
+ $.scrollTo($currentTarget.attr('href'), {
+ offset: -($('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight())
+ });
};
return Build;
diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml
index e2361a26769..e4d41288aa6 100644
--- a/app/views/projects/builds/show.html.haml
+++ b/app/views/projects/builds/show.html.haml
@@ -34,9 +34,9 @@
Build has been erased #{erased_by.html_safe} #{time_ago_with_tooltip(@build.erased_at)}
- else
#js-build-scroll.scroll-controls
- %a.step-up-trace.btn
+ = link_to '#build-trace', class: 'btn' do
%i.fa.fa-angle-up
- %a.step-down-trace.btn
+ = link_to '#down-build-trace', class: 'btn' do
%i.fa.fa-angle-down
%pre.build-trace#build-trace
%code.bash.js-build-output