Can't set domParent in default list - this breaks every KNL that is not attached...
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 12 May 2010 17:13:27 +0000 (11:13 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 12 May 2010 17:13:27 +0000 (11:13 -0600)
horde/js/KeyNavList.js

index 149a5a6..ea6d710 100644 (file)
@@ -47,12 +47,18 @@ var KeyNavList = Class.create({
             onChoose: Prototype.emptyFunction,
             onHide: Prototype.emptyFunction,
             onShow: Prototype.emptyFunction,
-            domParent: document.body,
+            domParent: null,
             keydownObserver: document
         }, opts || {});
 
         this.div = new Element('DIV', { className: 'KeyNavList' }).hide().insert(new Element('UL'));
-        this.opts.domParent.appendChild(this.div);
+
+        if (!this.opts.domParent) {
+            this.opts.domParent = document.body;
+        }
+        this.opts.domParent = $(this.opts.domParent);
+
+        this.opts.domParent.insert(this.div);
 
         if (this.opts.list) {
             this.update(this.opts.list);