From 8431a769cd80ba70c2b623751e6deacde3873247 Mon Sep 17 00:00:00 2001 From: alecpl Date: Sun, 10 Oct 2010 11:25:03 +0000 Subject: - Align drop down menus under main button (#1487048) --- skins/default/functions.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)) }); } -- cgit v1.2.3