]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/ui/frontends/qui.js
Add a reflow after a delay for Konqueror.
[irc/quakenet/qwebirc.git] / js / ui / frontends / qui.js
index f89fda4888e99c317667027af924fd766d243f18..6de600dbba2ba01f0f13f02491e79690a3a3b284 100644 (file)
@@ -1,5 +1,5 @@
 qwebirc.ui.QUI = new Class({
-  Extends: qwebirc.ui.NewLoginUI,
+  Extends: qwebirc.ui.RootUI,
   initialize: function(parentElement, theme, options) {
     this.parent(parentElement, qwebirc.ui.QUI.Window, "qui", options);
     this.theme = theme;
@@ -49,7 +49,8 @@ qwebirc.ui.QUI = new Class({
     
     this.createInput();
     this.reflow();
-
+    this.reflow.delay(100); /* Konqueror fix */
+    
     /* HACK, in Chrome this should work immediately but doesn't */
     this.__createDropdownHint.delay(100, this);
   },
@@ -423,19 +424,19 @@ qwebirc.ui.QUI.Window = new Class({
     parent.appendChild(e);
     e.addClass("menu");
     
+    var nickArray = [nick];
     qwebirc.ui.MENU_ITEMS.forEach(function(x) {
-      var text = x[0], fn = x[1], visible_fn = x[2];
-
-      if(visible_fn == qwebirc.ui.menuitems.fns.always || visible_fn.apply(this)) {
-        var e2 = new Element("a");
-        e.appendChild(e2);
+      if(!x.predicate || x.predicate !== true && !x.predicate.apply(this, nickArray))
+        return;
+      
+      var e2 = new Element("a");
+      e.appendChild(e2);
 
-        e2.href = "#";
-        e2.set("text", "- " + text);
+      e2.href = "#";
+      e2.set("text", "- " + x.text);
 
-        e2.addEvent("focus", function() { this.blur() }.bind(e2));
-        e2.addEvent("click", function(ev) { new Event(ev.stop()); this.menuClick(fn); }.bind(this));
-      }
+      e2.addEvent("focus", function() { this.blur() }.bind(e2));
+      e2.addEvent("click", function(ev) { new Event(ev.stop()); this.menuClick(x.fn); }.bind(this));
     }.bind(this));
     return e;
   },
@@ -485,7 +486,7 @@ qwebirc.ui.QUI.Window = new Class({
       this.prevNick = e;
       e.addClass("selected");
       this.moveMenuClass();
-      e.menu = this.createMenu(x.realNick, e);
+      e.menu = this.createMenu(e.realNick, e);
       new Event(x).stop();
     }.bind(this));