Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

Commit

Permalink
Delay advancing hints after manual advances
Browse files Browse the repository at this point in the history
  • Loading branch information
nmalkin committed Apr 6, 2012
1 parent 2774ec7 commit 689c2ac
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/frontend/startup.coffee
Expand Up @@ -190,13 +190,21 @@ $(document).ready ->
showHint hint showHint hint


# Rotate hints every 15 seconds # Rotate hints every 15 seconds
timeoutReset = false
setInterval (-> setInterval (->
showHint ++hint % HINTS.length if timeoutReset # There was a manual advance.
timeoutReset = false # Wait an extra cycle.
else # Show next hint
showHint ++hint % HINTS.length
), 1000*15 ), 1000*15


# ...or when the user advances them manually # ...or when the user advances them manually
$(PREVIOUS_HINT).click -> showHint ((--hint % HINTS.length) + HINTS.length) % HINTS.length $(PREVIOUS_HINT).click ->
$(NEXT_HINT).click -> showHint ++hint % HINTS.length timeoutReset = true
showHint ((--hint % HINTS.length) + HINTS.length) % HINTS.length
$(NEXT_HINT).click ->
timeoutReset = true
showHint ++hint % HINTS.length




importRooms = () -> importRooms = () ->
Expand Down

0 comments on commit 689c2ac

Please sign in to comment.