Skip to content

Commit

Permalink
Added support for window prompt when closing window thedjpetersen#53
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed Feb 24, 2012
1 parent 3c06533 commit b30ec79
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assets/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ $(function() {
irc.appView = new ChatApplicationView;

// EVENTS //

// **TODO**: is there a better place for this to go?
$(window).bind('beforeunload', function() {
if(!window.irc.connected) { return null; }
return "If you leave, you'll be signed out of Subway.";
});

irc.socket.emit('getDatabaseState', {});

irc.socket.on('databaseState', function(data) {
Expand Down

0 comments on commit b30ec79

Please sign in to comment.