BattleSim/client/app/js/concerns/exit_while_in_battle.coffee

8 lines
195 B
CoffeeScript
Raw Normal View History

2016-02-01 22:19:30 +00:00
# Prevents a clean escape while you're in a battle.
$(window).on 'beforeunload', ->
if PokeBattle.battles.isPlaying()
"You are currently in a battle."
else
# Do not prompt
return