diff options
author | alecpl <alec@alec.pl> | 2010-10-10 11:25:03 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-10-10 11:25:03 +0000 |
commit | 8431a769cd80ba70c2b623751e6deacde3873247 (patch) | |
tree | d131453b79a5d8dfb13fec1b18474350d90a7741 | |
parent | 29983c16711b7eb6828afab8ca87a09eec9f6fe3 (diff) |
- Align drop down menus under main button (#1487048)
-rw-r--r-- | skins/default/functions.js | 5 |
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)) }); } |