Skip to content

Commit

Permalink
toggle the forward arrow when you can't move into the future
Browse files Browse the repository at this point in the history
  • Loading branch information
interstateone committed Oct 23, 2012
1 parent 6157263 commit a9ea0ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion public/js/views/navbar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ define (require) ->
'click .moveBackward': 'clickedMoveBackward'
initialize: ->
app.vent.on 'scroll:window', @addDropShadow, @
app.vent.on 'app:changeOffset', @toggleForwardArrow, @
addDropShadow: ->
if window.pageYOffset > 0 then @$el.children().addClass 'nav-drop-shadow'
else @$el.children().removeClass 'nav-drop-shadow'
Expand All @@ -29,7 +30,12 @@ define (require) ->
app.vent.trigger 'app:moveForward'
clickedMoveBackward: ->
app.vent.trigger 'app:moveBackward'
showArrows: -> @$('.arrow').each -> $(@).show()
showArrows: ->
@$('.arrow').each -> $(@).show()
if app.offset is 0 then $('.moveForward').hide()
hideArrows: -> @$('.arrow').each -> $(@).hide()
toggleForwardArrow: ->
if app.offset is 0 then $('.moveForward').hide()
else $('.moveForward').show()
showBackButton: -> @$('.back').show()
hideBackButton: -> @$('.back').hide()

0 comments on commit a9ea0ca

Please sign in to comment.