]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/ui/qui.js
Add basic branding.
[irc/quakenet/qwebirc.git] / js / ui / qui.js
index 0f515dea2d0ac395a1b166e6ed9868cd3a654c69..5380befbec343cdc55ba5c52cb4861991e3142ab 100644 (file)
@@ -1,7 +1,7 @@
 qwebirc.ui.QUI = new Class({
   Extends: qwebirc.ui.NewLoginUI,
-  initialize: function(parentElement, theme) {
-    this.parent(parentElement, qwebirc.ui.QUI.Window, "qui");
+  initialize: function(parentElement, theme, options) {
+    this.parent(parentElement, qwebirc.ui.QUI.Window, "qui", options);
     this.theme = theme;
     this.parentElement = parentElement;
   },
@@ -221,8 +221,8 @@ qwebirc.ui.QUI.JSUI = new Class({
 qwebirc.ui.QUI.Window = new Class({
   Extends: qwebirc.ui.Window,
   
-  initialize: function(parentObject, client, type, name) {
-    this.parent(parentObject, client, type, name);
+  initialize: function(parentObject, client, type, name, identifier) {
+    this.parent(parentObject, client, type, name, identifier);
 
     this.tab = new Element("a", {"href": "#"});
     this.tab.addClass("tab");
@@ -260,7 +260,12 @@ qwebirc.ui.QUI.Window = new Class({
       
       tabclose.addEvent("click", close);
       this.tab.addEvent("mouseup", function(e) {
-        if(e.event.button == 1)
+        var button = 1;
+        
+        if(Browser.Engine.trident)
+          button = 4;
+
+        if(e.event.button == button)
           close(e);
       }.bind(this));
       
@@ -270,9 +275,12 @@ qwebirc.ui.QUI.Window = new Class({
     this.lines = new Element("div");
     this.parentObject.qjsui.applyClasses("middle", this.lines);
     this.lines.addClass("lines");
+    if(type != qwebirc.ui.WINDOW_CUSTOM && type != qwebirc.ui.WINDOW_CONNECT)
+      this.lines.addClass("ircwindow");
     
     this.lines.addEvent("scroll", function() {
       this.scrolleddown = this.scrolledDown();
+      this.scrollpos = this.getScrollParent().getScroll();
     }.bind(this));
     
     if(type == qwebirc.ui.WINDOW_CHANNEL) {
@@ -300,8 +308,19 @@ qwebirc.ui.QUI.Window = new Class({
     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");