Skip to content
Snippets Groups Projects
Commit 2968b02a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge pull request #25 from jojosch/auto-scroll

add autoscroll to build trace
parents 3b791168 108f95c9
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -14,10 +14,15 @@
//= require jquery_ujs
//= require_tree .
//
function getBuild(buildPath, buildId) {
function getBuild(buildPath, buildId) {
console.log('run');
setTimeout(function() {
$.get(buildPath + ".js?bid=" + buildId);
}, 3000);
}
 
function checkAutoscroll() {
if('enabled' === $("#autoscroll-button").data('state')) {
$("html,body").scrollTop($("#build-trace").height());
}
}
$(document).ready ->
$("#autoscroll-button").bind "click", ->
state = $(this).data("state")
if "enabled" is state
$(this).data "state", "disabled"
$(this).text "enable autoscroll"
else
$(this).data "state", "enabled"
$(this).text "disable autoscroll"
Loading
Loading
@@ -80,6 +80,10 @@ pre.trace {
overflow-y: hidden;
}
 
.autoscroll-container {
margin-bottom: 5px;
}
.navbar .navbar-inner { border-radius: 0; }
 
.builds {
Loading
Loading
Loading
Loading
@@ -61,9 +61,14 @@
#{@build.git_commit_message}
 
.clearfix
- if @build.active?
.autoscroll-container.pull-right
%button.btn.btn-mini#autoscroll-button{:type => "button", :data => {:state => 'disabled'}} enable autoscroll
.clearfix
%pre.trace#build-trace
= preserve do
= raw @build.trace_html
.span3
.builds
%h5 Builds for #{@build.short_sha}:
Loading
Loading
Loading
Loading
@@ -2,6 +2,7 @@
:plain
$('#build-trace').html("#{escape_javascript(@build.trace_html)}");
$('#build-trace').append('#{loader_html}');
checkAutoscroll();
getBuild('#{project_build_path(@project, @build)}', '#{@build.id}');
- else
:plain
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment