summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2016-09-09 19:50:53 +0100
committerLuke Bennett <lukeeeebennettplus@gmail.com>2016-09-09 21:22:18 +0100
commitb5d74bef8e3ccd18072267cc660ccdcbfd65eebf (patch)
tree94d87a4fa18198962c253370510ab941b3c56d98 /app
parent1417437590a347e30b1a3ee96b218f8eaf635366 (diff)
downloadgitlab-ce-b5d74bef8e3ccd18072267cc660ccdcbfd65eebf.tar.gz
trace step buttons now scroll 50px up or down at a time
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/build.js13
-rw-r--r--app/views/projects/builds/show.html.haml4
2 files changed, 13 insertions, 4 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js
index 10abeb50f4b..35c0c17d666 100644
--- a/app/assets/javascripts/build.js
+++ b/app/assets/javascripts/build.js
@@ -27,10 +27,11 @@
$(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);
this.updateArtifactRemoveDate();
if ($('#build-trace').length) {
this.getInitialBuildTrace();
- this.initScrollButtonAffix();
+ this.initScrollButtons();
}
if (this.build_status === "running" || this.build_status === "pending") {
$('#autoscroll-button').on('click', function() {
@@ -106,7 +107,7 @@
}
};
- Build.prototype.initScrollButtonAffix = function() {
+ Build.prototype.initScrollButtons = function() {
var $body, $buildScroll, $buildTrace;
$buildScroll = $('#js-build-scroll');
$body = $('body');
@@ -165,6 +166,14 @@
this.populateJobs(stage);
};
+ Build.prototype.stepTrace = function(e) {
+ if ($(e.currentTarget).hasClass('step-up-trace')) {
+ $.scrollTo('-=50px');
+ } else {
+ $.scrollTo('+=50px');
+ }
+ };
+
return Build;
})();
diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml
index e4d41288aa6..e2361a26769 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
- = link_to '#build-trace', class: 'btn' do
+ %a.step-up-trace.btn
%i.fa.fa-angle-up
- = link_to '#down-build-trace', class: 'btn' do
+ %a.step-down-trace.btn
%i.fa.fa-angle-down
%pre.build-trace#build-trace
%code.bash.js-build-output