svn commit: r933169 - /ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r933169 - /ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js

jleroux@apache.org
Author: jleroux
Date: Mon Apr 12 10:04:39 2010
New Revision: 933169

URL: http://svn.apache.org/viewvc?rev=933169&view=rev
Log:
A slightly modified patch from Atul Vani "Calendar rendered position too low when you scroll in a layered lookup" (https://issues.apache.org/jira/browse/OFBIZ-3667) - OFBIZ-3667

This patch attempts to fix the problem,calendar is now relatively positioned, and the parent element's height is set appropriately.

I just added some "mod for OFBiz layered lookups" comments around changes as suggested Sascha

Modified:
    ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js

Modified: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js?rev=933169&r1=933168&r2=933169&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js Mon Apr 12 10:04:39 2010
@@ -119,11 +119,20 @@ CalendarDateSelect.prototype = {
     var e_dim = $(this.options.get("popup_by")).positionedOffset(), e_top = e_dim[1], e_left = e_dim[0], e_height = $(this.options.get("popup_by")).getDimensions().height, e_bottom = e_top + e_height;
 
     if ( (( e_bottom + c_height ) > (w_top + w_height)) && ( e_bottom - c_height > w_top )) above = true;
-    var left_px = e_left.toString() + "px", top_px = (above ? (e_top - c_height ) : ( e_bottom )).toString() + "px";
-
-    this.calendar_div.style.left = left_px;  this.calendar_div.style.top = top_px;
+    /* mod for OFBiz layered lookups
+    var left_px = e_left.toString() + "px", top_px = (above ? (e_top - c_height ) : ( e_bottom )).toString() + "px";*/
+    var top_px = (above ? -(e_height + c_height) : "0").toString() + "px";
+    /* end mod*/
+
+    /* mod for OFBiz layered lookups
+    this.calendar_div.style.left = left_px;  this.calendar_div.style.top = top_px;*/
+    this.calendar_div.style.left = "0px";  this.calendar_div.style.top = top_px;
+    /* end mod*/
 
     this.calendar_div.setStyle({visibility:""});
+    /* mod for OFBiz layered lookups*/
+    this.target_element.up().style.height = e_height.toString() + "px";
+    /* end mod*/
 
     // draw an iframe behind the calendar -- ugly hack to make IE 6 happy
     if(navigator.appName=="Microsoft Internet Explorer") this.iframe = $(document.body).build("iframe", {src: "javascript:false", className: "ie6_blocker"}, { left: left_px, top: top_px, height: c_height.toString()+"px", width: c_width.toString()+"px", border: "0px"})
@@ -134,7 +143,10 @@ CalendarDateSelect.prototype = {
       var style = {}
     } else {
       var parent = document.body
-      var style = { position:"absolute", visibility: "hidden", left:0, top:0 }
+      /* mod for OFBiz layered lookups
+      var style = { position:"absolute", visibility: "hidden", left:0, top:0 }*/
+      var style = { position:"relative", visibility: "hidden", left:0, top:0 }
+      /* end mod */
     }
     this.calendar_div = this.target_element.up().build('div', {className: "calendar_date_select"}, style);