summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--skins/default/functions.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/skins/default/functions.js b/skins/default/functions.js
index 82f7c1562..d5e38d5cd 100644
--- a/skins/default/functions.js
+++ b/skins/default/functions.js
@@ -124,9 +124,12 @@ show_popupmenu: function(popup, show)
show = false;
if (show && ref) {
- var pos = $(ref).offset();
+ var parent = $(ref).parent(),
+ pos = parent.hasClass('dropbutton') ? parent.offset() : $(ref).offset();
+
if (!above && pos.top + ref.offsetHeight + obj.height() > window.innerHeight)
above = true;
+
obj.css({ left:pos.left, top:(pos.top + (above ? -obj.height() : ref.offsetHeight)) });
}