},
postInitialize: function() {
this.qjsui = new qwebirc.ui.QUI.JSUI("qwebirc-qui", this.parentElement);
-
+ this.qjsui.addEvent("reflow", function() {
+ var w = this.getActiveWindow();
+ if($defined(w))
+ w.onResize();
+ }.bind(this));
this.qjsui.top.addClass("tabbar");
this.qjsui.bottom.addClass("input");
});
qwebirc.ui.QUI.JSUI = new Class({
+ Implements: [Events],
initialize: function(class_, parent, sizer) {
this.parent = parent;
this.sizer = $defined(sizer)?sizer:parent;
right.setStyle("left", mwidth + "px");
bottom.setStyle("top", (docsize.y - bottomsize.y) + "px");
+ this.fireEvent("reflow");
},
showChannel: function(state) {
var display = "none";
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) {
+ var button = 1;
+
+ if(Browser.Engine.trident)
+ button = 4;
+
+ if(e.event.button == button)
+ close(e);
}.bind(this));
this.tab.appendChild(tabclose);
this.lines.addEvent("scroll", function() {
this.scrolleddown = this.scrolledDown();
+ this.scrollpos = this.getScrollParent().getScroll();
}.bind(this));
if(type == qwebirc.ui.WINDOW_CHANNEL) {
this.parentObject.reflow();
},
onResize: function() {
- if(this.scrolleddown)
- this.scrollToBottom();
+ if(this.scrolleddown) {
+ if(Browser.Engine.trident) {
+ this.scrollToBottom.delay(5, this);
+ } else {
+ this.scrollToBottom();
+ }
+ } else if($defined(this.scrollpos)) {
+ if(Browser.Engine.trident) {
+ this.getScrollParent().scrollTo(this.scrollpos.x, this.scrollpos.y);
+ } else {
+ this.getScrollParent().scrollTo.delay(5, this, [this.scrollpos.x, this.scrollpos.y]);
+ }
+ }
},
createMenu: function(nick, parent) {
var e = new Element("div");