Permalink
Browse files

Added support for window prompt when closing window #53

  • Loading branch information...
1 parent 3c06533 commit b30ec794ce05f261ff1a762279f892006e5f10e3 @niftylettuce niftylettuce committed Feb 24, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 assets/js/client.js
View
@@ -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) {

0 comments on commit b30ec79

Please sign in to comment.