From e326a0fe118771a3792cdce58925de328ad2d4a2 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 3 Feb 2015 14:08:41 -0700 Subject: [PATCH] [mms] Make dynamic context menus scrollable if taller than the browser screen height (Bug #13833). Conflicts: horde/docs/CHANGES horde/package.xml --- horde/docs/CHANGES | 9 +++++++++ horde/js/contextsensitive.js | 13 ++++++++++--- horde/package.xml | 1 + horde/themes/default/screen.css | 1 + 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/horde/docs/CHANGES b/horde/docs/CHANGES index 369365ff362..e002d5d9c82 100644 --- a/horde/docs/CHANGES +++ b/horde/docs/CHANGES @@ -12,6 +12,15 @@ v5.3.0-git #13200). +------ +v5.2.4 +------ +[mms] Make dynamic context menus scrollable if taller than the browser screen + height (Bug #13833). +[jan] Fix horde-import-squirrelmail-prefs script (Bug #13780). +[jan] Don't instantiate notification system for RPC requests. + + ------ v5.2.3 ------ diff --git a/horde/js/contextsensitive.js b/horde/js/contextsensitive.js index f85a5b9df60..9073834b8c8 100644 --- a/horde/js/contextsensitive.js +++ b/horde/js/contextsensitive.js @@ -317,12 +317,19 @@ var ContextSensitive = Class.create({ eltL = elt.getLayout(); h = eltL.get('border-box-height'); w = eltL.get('border-box-width'); - elt.hide().setStyle({ visibility: 'visible' }); + elt.hide().setStyle({ + height: 'auto', + visibility: 'visible' + }); v = document.viewport.getDimensions(); // Make sure context window is entirely on screen - if ((y + h) > v.height) { - y = v.height - h - 2; + if ((y + h + 5) > v.height) { + y = Math.max(5, v.height - h - 5); + + if (h - 10 > v.height) { + elt.setStyle({ height: (v.height - 10) + 'px' }); + } } if ((x + w) > v.width) { diff --git a/horde/package.xml b/horde/package.xml index f5cf225c9aa..64f05d4948b 100644 --- a/horde/package.xml +++ b/horde/package.xml @@ -4102,6 +4102,7 @@ 2014-12-03 LGPL-2 +* [mms] Make dynamic context menus scrollable if taller than the browser screen height (Bug #13833). * [jan] Fix horde-import-squirrelmail-prefs script (Bug #13780). * [jan] Don't instantiate notification system for RPC requests. diff --git a/horde/themes/default/screen.css b/horde/themes/default/screen.css index bfd69d6fdd4..7c465d4a0a1 100644 --- a/horde/themes/default/screen.css +++ b/horde/themes/default/screen.css @@ -1400,6 +1400,7 @@ div.GrowlerNoticeExit { .context { top: 0; left: 0; + overflow-y: auto; } .context a, .context a:visited, .horde-buttonbar li div li a { white-space: nowrap;