View Issue Details

IDProjectCategoryView StatusLast Update
0000535SOGoWeb Generalpublic2010-03-31 21:00
ReporterJason Oster Assigned Tofrancis  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.2.1 
Fixed in Version1.2.2 
Summary0000535: [patch] Popup menus opening partially off-screen
Description

The deltaX/deltaY variables in generic.js:popupMenu() are not used when calculating the popup menu position vs. the menu width & height. The attached patch is a fix.

Additional Information

Note that this patch also includes the addition of 1 to the heightDiff and leftDiff variables. This ensures that the menu will not appear under the mouse cursor. A click event fires on the popup menu after opening it if it's under the cursor when the right button is released; closing the menu.

TagsNo tags attached.

Activities

2010-03-31 19:35

 

SOGo-popup_position.patch (847 bytes)   
--- UI/WebServerResources/generic.js~	2010-03-31 04:02:48.000000000 -0700
+++ UI/WebServerResources/generic.js	2010-03-31 12:30:06.443333062 -0700
@@ -536,13 +536,13 @@ function popupMenu(event, menuId, target
 
     var menuTop = Event.pointerY(event) + deltaY;
     var menuLeft = Event.pointerX(event) + deltaX;
-    var heightDiff = (window.height()
-                      - (menuTop + popup.offsetHeight));
+    var heightDiff = ((window.height() + deltaY)
+                      - (menuTop + popup.offsetHeight + 1));
     if (heightDiff < 0)
         menuTop += heightDiff;
 
-    var leftDiff = (window.width()
-                    - (menuLeft + popup.offsetWidth));
+    var leftDiff = ((window.width() + deltaX)
+                    - (menuLeft + popup.offsetWidth + 1));
     if (leftDiff < 0)
         menuLeft -= popup.offsetWidth;
 
SOGo-popup_position.patch (847 bytes)   
Jason Oster

Jason Oster

2010-03-31 20:02

reporter   ~0000838

Update to patch: the +1 was not getting added to the actual position in the leftDiff case.

2010-03-31 20:03

 

SOGo-popup_position-v2.patch (894 bytes)   
--- UI/WebServerResources/generic.js~	2010-03-31 04:02:48.000000000 -0700
+++ UI/WebServerResources/generic.js	2010-03-31 12:59:14.463344552 -0700
@@ -536,15 +536,15 @@ function popupMenu(event, menuId, target
 
     var menuTop = Event.pointerY(event) + deltaY;
     var menuLeft = Event.pointerX(event) + deltaX;
-    var heightDiff = (window.height()
-                      - (menuTop + popup.offsetHeight));
+    var heightDiff = ((window.height() + deltaY)
+                      - (menuTop + popup.offsetHeight + 1));
     if (heightDiff < 0)
         menuTop += heightDiff;
 
-    var leftDiff = (window.width()
+    var leftDiff = ((window.width() + deltaX)
                     - (menuLeft + popup.offsetWidth));
     if (leftDiff < 0)
-        menuLeft -= popup.offsetWidth;
+        menuLeft -= (popup.offsetWidth + 1);
 
     var isVisible = true;
     if (popup.prepareVisibility)
francis

francis

2010-03-31 21:00

administrator   ~0000840

Nice catch! Thanks for the patch.

Fixed in revision b4e7bba523520804e5e2156a93f9fd775463b75f

Issue History

Date Modified Username Field Change
2010-03-31 19:35 Jason Oster New Issue
2010-03-31 19:35 Jason Oster File Added: SOGo-popup_position.patch
2010-03-31 20:02 Jason Oster Note Added: 0000838
2010-03-31 20:03 Jason Oster File Added: SOGo-popup_position-v2.patch
2010-03-31 21:00 francis Note Added: 0000840
2010-03-31 21:00 francis Status new => resolved
2010-03-31 21:00 francis Fixed in Version => 1.2.2
2010-03-31 21:00 francis Resolution open => fixed
2010-03-31 21:00 francis Assigned To => francis