stop autoscrolling on scroll up event, idea by courtesy of @rkh

This commit is contained in:
Sven Fuchs 2012-09-23 01:02:41 +02:00
parent b40dfe044b
commit 92f6ff4adc
4 changed files with 27 additions and 3 deletions

View File

@ -1,5 +1,6 @@
@Travis.Tailing = ->
$(window).scroll(@positionButton.bind(this))
@position = $(window).scrollTop()
$(window).scroll(@onScroll.bind(this))
this
$.extend Travis.Tailing.prototype,
@ -8,6 +9,7 @@ $.extend Travis.Tailing.prototype,
run: ->
@autoScroll()
@positionButton()
Ember.run.later(@run.bind(this), @options.timeout) if @active()
toggle: (event) ->
@ -31,6 +33,12 @@ $.extend Travis.Tailing.prototype,
winBottom = win.scrollTop() + win.height()
win.scrollTop(logBottom - win.height()) if logBottom - winBottom > 0
onScroll: ->
@positionButton()
position = $(window).scrollTop()
@stop() if position < @position
@position = position
positionButton: ->
tail = $('#tail')
return if tail.length is 0

View File

@ -40,7 +40,7 @@ body > div
// @include transition(width .1s ease-out)
$step: 12px
@for $i from 1 through 10
@for $i from 1 through 11
@media screen and (min-width: (1180px + $i * $step * 2))
body
background-position-x: ($left-width + $i * $step - 790px)

File diff suppressed because one or more lines are too long

View File

@ -1983,6 +1983,22 @@ body > div {
margin-left: 410px;
}
}
@media screen and (min-width: 1444px) {
/* line 45, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/layout.sass */
body {
background-position-x: -408px;
}
/* line 47, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/layout.sass */
#left {
width: 382px;
}
/* line 49, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/layout.sass */
#main {
margin-left: 422px;
}
}
@media screen and (max-width: 1400px) {
/* line 53, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/layout.sass */
#left .duration_label {