diff --git a/cmd/droned/assets/css/drone.css b/cmd/droned/assets/css/drone.css index 4676616b..77b7ee7b 100644 --- a/cmd/droned/assets/css/drone.css +++ b/cmd/droned/assets/css/drone.css @@ -1082,3 +1082,14 @@ ul.account-radio-group li img { .url { word-break: break-all; } +#follow { + position: relative; + z-index: 100; + float: right; + right: 1em; + top: -2.5em; + padding: 0 1em; + border-radius: 7px; + background: #999; + cursor: pointer; +} diff --git a/cmd/droned/assets/css/drone.less b/cmd/droned/assets/css/drone.less index 8e4263aa..433ed20b 100644 --- a/cmd/droned/assets/css/drone.less +++ b/cmd/droned/assets/css/drone.less @@ -1271,3 +1271,17 @@ pre { .url { word-break: break-all; } + +#follow { + position: relative; + z-index: 100; + float: right; + right: 1em; + top: -2.5em; + padding: 0 1em; + border-radius: 7px; + background: #999; + cursor: pointer; +} + + diff --git a/pkg/template/pages/repo_commit.html b/pkg/template/pages/repo_commit.html index 985e733b..ec64a802 100644 --- a/pkg/template/pages/repo_commit.html +++ b/pkg/template/pages/repo_commit.html @@ -45,14 +45,25 @@
+ Follow {{ end }} {{ define "script" }} @@ -124,7 +135,9 @@ outputWS.onclose = function (e) { window.location.reload(); }; outputWS.onmessage = function (e) { outputBox.innerHTML += formatLine(e.data); - window.scrollTo(0, document.body.scrollHeight) + if (window.autofollow) { + window.scrollTo(0, document.body.scrollHeight); + } }; {{ else }} $.get("/{{ .Repo.Slug }}/commit/{{ .Commit.Hash }}/build/{{ .Build.Slug }}/out.txt", function( data ) { @@ -132,4 +145,4 @@ }); {{ end }} -{{ end }} \ No newline at end of file +{{ end }}