From: Arne Jensen Date: Mon, 13 Feb 2012 01:29:38 +0000 (+0000) Subject: Fixes issue #174. X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/commitdiff_plain/a2e51e77e68317f78f8e5f57f1264336784f6d94 Fixes issue #174. --- 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({