this.scrollpos = null;
this.lastNickHash = {};
this.lastSelected = null;
+ this.closed = false;
},
updateNickList: function(nicks) {
},
qwebirc.ui.Colourise("[" + topic + "]", element, this.client.exec, this.parentObject.urlDispatcher.bind(this.parentObject), this);
},
close: function() {
+ this.closed = true;
+
if($defined(this.scrolltimer)) {
$clear(this.scrolltimer);
this.scrolltimer = null;
this.tab.appendText(name);
this.tab.addEvent("click", function(e) {
new Event(e).stop();
+
+ if(this.closed)
+ return;
+
parentObject.selectWindow(this);
}.bind(this));
var tabclose = new Element("span");
tabclose.set("text", "X");
tabclose.addClass("tabclose");
- tabclose.addEvent("click", function(e) {
+ var close = function(e) {
new Event(e).stop();
+ if(this.closed)
+ return;
+
if(type == qwebirc.ui.WINDOW_CHANNEL)
this.client.exec("/PART " + name);
this.close();
parentObject.inputbox.focus();
+ }.bind(this);
+
+ tabclose.addEvent("click", close);
+ this.tab.addEvent("mouseup", function(e) {
+ if(e.event.button == 1)
+ close(e);
}.bind(this));
this.tab.appendChild(tabclose);