diff options
author | Arne Jensen <darkdevil@darkdevil.dk> | 2012-02-13 01:29:38 (GMT) |
---|---|---|
committer | Arne Jensen <darkdevil@darkdevil.dk> | 2012-02-13 01:29:38 (GMT) |
commit | f59d0047805b4ae11343b842b7b73e71bd007c62 (patch) | |
tree | f9837097f61517f8e8dca5c3bae32d35fd775caa | |
parent | 9cb19ca883b264a4388b4e49b472832000fcd710 (diff) |
Fixes issue #187.
-rw-r--r-- | js/irc/ircclient.js | 2 | ||||
-rw-r--r-- | js/qwebirc.js | 2 | ||||
-rw-r--r-- | js/qwebircinterface.js | 12 |
3 files changed, 10 insertions, 6 deletions
diff --git a/js/irc/ircclient.js b/js/irc/ircclient.js index 75bd259..a26ae86 100644 --- a/js/irc/ircclient.js +++ b/js/irc/ircclient.js @@ -523,6 +523,7 @@ qwebirc.irc.IRCClient = new Class({ } this.tracker = undefined; + qwebirc.connected = false; this.newServerLine("DISCONNECT", {"m": message}); }, nickOnChanHasPrefix: function(nick, channel, prefix) { @@ -565,6 +566,7 @@ qwebirc.irc.IRCClient = new Class({ this.parent(key, value); }, connected: function() { + qwebirc.connected = true; this.newServerLine("CONNECT"); }, serverError: function(message) { diff --git a/js/qwebirc.js b/js/qwebirc.js index 8601caa..03e8b80 100644 --- a/js/qwebirc.js +++ b/js/qwebirc.js @@ -1,4 +1,4 @@ -var qwebirc = {ui: {themes: {}, style: {}}, irc: {}, util: {crypto: {}}, config: {}, auth: {}, sound: {}}; +var qwebirc = {ui: {themes: {}, style: {}}, irc: {}, util: {crypto: {}}, config: {}, auth: {}, sound: {}, connected: false}; if(typeof QWEBIRC_BUILD != "undefined") { qwebirc.BUILD = QWEBIRC_BUILD; diff --git a/js/qwebircinterface.js b/js/qwebircinterface.js index c290d94..1d7f249 100644 --- a/js/qwebircinterface.js +++ b/js/qwebircinterface.js @@ -1,9 +1,11 @@ function qwebirc_ui_onbeforeunload(e) { /* IE sucks */ - var message = "This action will close all active IRC connections."; - var e = e || window.event; - if(e) - e.returnValue = message; - return message; + if(qwebirc.connected) { + var message = "This action will close all active IRC connections."; + var e = e || window.event; + if(e) + e.returnValue = message; + return message; + } } qwebirc.ui.Interface = new Class({ |