Skip to content

Instantly share code, notes, and snippets.

@drale2k
Created July 29, 2012 19:00
Show Gist options
  • Save drale2k/3201151 to your computer and use it in GitHub Desktop.
Save drale2k/3201151 to your computer and use it in GitHub Desktop.
endSession: ->
do restartSession = ->
restartSessionTimer = setTimeout ->
window.location.href = Etaxi.config.base_url
, Etaxi.config.user_session_length
do showRestartSessionAlert = ->
showRestartSessionAlertTimer = setTimeout ->
$z("#notification").animate
translateY: 0
opacity: 1
400
"ease-in-out"
, Etaxi.config.user_session_length_notify
$(window).on "touchend", ->
$z("#notification").animate
translateY: "-100%"
opacity: 0
400
"ease-in-out"
clearTimeout(restartSessionTimer)
clearTimeout(showRestartSessionAlertTimer)
restartSession()
showRestartSessionAlert()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment