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

8 lines
195 B
CoffeeScript

# 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