From 106c6a24ae1a2254a8a983de829a89e1c0313bae Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 6 Nov 2015 09:40:36 -0500 Subject: [PATCH] (js) Fix dialogs when partially visible Fixes #2646, #3378 --- NEWS | 2 ++ UI/WebServerResources/SchedulerUI.js | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/NEWS b/NEWS index 01021452b..2e6c82aa1 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,8 @@ Bug fixes - handle emails having an attachment as their content - fixed JavaScript syntax error in attendees editor - fixed wrong comparison of meta vs. META tag in HTML mails + - fixed popup menu position when moved to the left (#3381) + - fixed dialog position when at the bottom of the window (#2646, #3378) 2.3.2 (2015-09-16) ------------------ diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 2151ce95e..50ff9763c 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -856,6 +856,11 @@ function onViewEventCallback(http) { } else para.hide(); + var windowHeight = window.height(); + var bottomOffset = windowHeight - div.getDimensions().height - top; + if (bottomOffset < 0) + top += bottomOffset; + div.setStyle({ left: left + "px", top: top + "px" }); div.show(); configureLinks(div); @@ -3493,6 +3498,12 @@ function onCalendarImport(event) { var div = $("uploadDialog"); var res = $("uploadResults"); + + var windowHeight = window.height(); + var bottomOffset = windowHeight - div.getDimensions().height - top; + if (bottomOffset < 0) + top += bottomOffset; + res.setStyle({ top: top + "px", left: left + "px" }); div.setStyle({ top: top + "px", left: left + "px" }); div.show();