Fix offset in IE if not attaching knl to body.
authorJan Schneider <jan@horde.org>
Fri, 21 May 2010 14:31:33 +0000 (16:31 +0200)
committerJan Schneider <jan@horde.org>
Fri, 21 May 2010 14:31:33 +0000 (16:31 +0200)
horde/js/keynavlist.js

index 58c4c27..af6ec11 100644 (file)
@@ -132,10 +132,12 @@ var KeyNavList = Class.create({
 
         this.opts.onShow(this.div);
 
+        var delta = this.div.getOffsetParent().viewportOffset().relativeTo(this.opts.domParent.viewportOffset());
         this.div.setStyle({ height: null, width: null, top: null }).clonePosition(this.base, {
             setHeight: false,
             setWidth: false,
-            offsetTop: this.base.getHeight()
+            offsetLeft: delta[0],
+            offsetTop: this.base.getHeight() + delta[1]
         });
 
         if (this.div.visible()) {