Merge pull request #227 from dmathieu/fluid_scrolling_buttons
Fluid scrolling buttons
This commit is contained in:
commit
18a7f9b09e
|
@ -45,8 +45,9 @@ $.extend Travis.Tailing.prototype,
|
|||
offset = $(window).scrollTop() - $('#log').offset().top
|
||||
max = $('#log').height() - $('#tail').height() + 5
|
||||
offset = max if offset > max
|
||||
if offset > 0
|
||||
tail.css(top: offset - 2)
|
||||
else
|
||||
tail.css(top: 0)
|
||||
|
||||
if offset > 0
|
||||
tail.css(position: 'fixed', right: 32)
|
||||
else
|
||||
tail.css(position: 'absolute', right: 2)
|
||||
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
<div id="log-container">
|
||||
<a href="#" id="tail" {{action "toggleTailing" target="view"}}>
|
||||
<span class="status"></span>
|
||||
<label>Follow logs</label>
|
||||
|
||||
<label>
|
||||
{{#if view.job.isFinished}}
|
||||
Scroll to end of logs
|
||||
{{else}}
|
||||
Follow logs
|
||||
{{/if}}
|
||||
</label>
|
||||
</a>
|
||||
<pre id="log" class="ansi"></pre>
|
||||
|
||||
|
|
|
@ -97,6 +97,7 @@ Travis.reopen
|
|||
window.history.pushState({ path: path }, null, path);
|
||||
@set('controller.lineNumber', number)
|
||||
|
||||
actions:
|
||||
toTop: () ->
|
||||
$(window).scrollTop(0)
|
||||
|
||||
|
|
|
@ -86,7 +86,8 @@ pre#log
|
|||
#log-container
|
||||
position: relative
|
||||
|
||||
#log-container #tail
|
||||
#log-container
|
||||
#tail
|
||||
z-index: 99
|
||||
position: absolute
|
||||
display: block
|
||||
|
@ -127,3 +128,16 @@ pre#log
|
|||
|
||||
&.active .status
|
||||
background-color: #6b0
|
||||
|
||||
.to-top
|
||||
position: fixed
|
||||
display: inline-block
|
||||
bottom: 5px
|
||||
right: 35px
|
||||
width: 50px
|
||||
float: right
|
||||
margin-right: 2px
|
||||
padding-right: 16px
|
||||
text-align: right
|
||||
color: #999
|
||||
background: inline-image('ui/to-top.png') no-repeat right 6px
|
||||
|
|
|
@ -3,12 +3,3 @@
|
|||
// float: left
|
||||
margin-top: 0
|
||||
color: #999
|
||||
.to-top
|
||||
display: inline-block
|
||||
width: 50px
|
||||
float: right
|
||||
margin-right: 2px
|
||||
padding-right: 16px
|
||||
text-align: right
|
||||
color: #999
|
||||
background: inline-image('ui/to-top.png') no-repeat right 6px
|
||||
|
|
Loading…
Reference in New Issue
Block a user