details:   https://code.openbravo.com/erp/devel/pi/rev/04147d5e6a99
changeset: 16469:04147d5e6a99
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Thu May 10 02:12:21 2012 +0200
summary:   Related to issue 20207: Improved Dojo grids visualization in IE9 
using HTML5

diffstat:

 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_forms/BatchPaymentExecution.html
 |  47 +++++++--
 web/js/searchs.js                                                              
                           |  14 ++-
 web/js/utils.js                                                                
                           |  11 +-
 3 files changed, 52 insertions(+), 20 deletions(-)

diffs (131 lines):

diff -r 7e3737728bba -r 04147d5e6a99 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_forms/BatchPaymentExecution.html
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_forms/BatchPaymentExecution.html
 Mon May 07 11:59:34 2012 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_forms/BatchPaymentExecution.html
 Thu May 10 02:12:21 2012 +0200
@@ -93,8 +93,18 @@
 function calculateNumRows() {
   resizeArea();
   document.getElementById("grid_sample").style.display = "block";
-  var grid_header_height = 
document.getElementById("grid_sample_header").clientHeight + 1;
-  var grid_row_height = 
document.getElementById("grid_sample_row").clientHeight + 1;
+  var grid_header = document.getElementById("grid_sample_header");
+  var grid_row = document.getElementById("grid_sample_row");
+  var grid_header_height, grid_row_height;
+
+  if (isIE9Strict) {
+    grid_header_height = parseInt(getComputedStyle(grid_header, 
null).getPropertyValue("height").replace('px', ''), 10) + 4;
+    grid_row_height = parseInt(getComputedStyle(grid_row, 
null).getPropertyValue("height").replace('px', ''), 10) + 1;
+  } else {
+    grid_header_height = grid_header.clientHeight + 1;
+    grid_row_height = grid_row.clientHeight + 1;
+  }
+
   if (getBrowserInfo('name').toUpperCase().indexOf("CHROME") != -1 || 
getBrowserInfo('name').toUpperCase().indexOf("SAFARI") != -1) {
     grid_header_height = grid_header_height + 1;
     grid_row_height = grid_row_height - 1;
@@ -108,19 +118,28 @@
   var bottomrow_cont = document.getElementById("bottomRow");
   var related_info_cont = document.getElementById("related_info_cont");
   var client_height = document.getElementById("client").clientHeight;
+  
+  if (isIE9Strict) {
+    client_height = client_height
+        - 25
+        - grid_header_height
+        - (related_info_cont?related_info_cont.clientHeight:0)
+        - 30 - 30 - 30 - 36 - 40 - 40
+        - (messagebox_cont?messagebox_cont.clientHeight:0);
+  } else {
+    client_height = client_height
+        - 20
+        - grid_header_height
+        - (related_info_cont?related_info_cont.clientHeight:0)
+        - (filterRow1_cont?filterRow1_cont.clientHeight:0)
+        - (filterRow2_cont?filterRow2_cont.clientHeight:0)
+        - (filterRow3_cont?filterRow3_cont.clientHeight:0)
+        - (filterRow4_cont?filterRow4_cont.clientHeight:0)
+        - (filterRow5_cont?filterRow5_cont.clientHeight:0)
+        - (bottomrow_cont?bottomrow_cont.clientHeight:0)
+        - (messagebox_cont?messagebox_cont.clientHeight:0);
+  }
 
-  client_height = client_height
-      - grid_header_height
-      - (related_info_cont?related_info_cont.clientHeight:0)
-      - (filterRow1_cont?filterRow1_cont.clientHeight:0)
-      - (filterRow2_cont?filterRow2_cont.clientHeight:0)
-      - (filterRow3_cont?filterRow3_cont.clientHeight:0)
-      - (filterRow4_cont?filterRow4_cont.clientHeight:0)
-      - (filterRow5_cont?filterRow5_cont.clientHeight:0)
-      - (bottomrow_cont?bottomrow_cont.clientHeight:0)
-      - (messagebox_cont?messagebox_cont.clientHeight:0);
-  
-  client_height = client_height - 20;
   var numRows = (client_height)/(grid_row_height);
   numRows = parseInt(numRows);
   if (numRows > 1) { numRows -= 1; }
diff -r 7e3737728bba -r 04147d5e6a99 web/js/searchs.js
--- a/web/js/searchs.js Mon May 07 11:59:34 2012 +0200
+++ b/web/js/searchs.js Thu May 10 02:12:21 2012 +0200
@@ -514,8 +514,18 @@
 function calculateNumRows() {
    resizeAreaInfo();
    document.getElementById("grid_sample").style.display = "block";
-   var grid_header_height = 
document.getElementById("grid_sample_header").clientHeight + 1;
-   var grid_row_height = 
document.getElementById("grid_sample_row").clientHeight + 1;
+   var grid_header = document.getElementById("grid_sample_header");
+   var grid_row = document.getElementById("grid_sample_row");
+   var grid_header_height, grid_row_height;
+
+   if (isIE9Strict) {
+     grid_header_height = parseInt(getComputedStyle(grid_header, 
null).getPropertyValue("height").replace('px', ''), 10) + 4;
+     grid_row_height = parseInt(getComputedStyle(grid_row, 
null).getPropertyValue("height").replace('px', ''), 10) + 1;
+   } else {
+     grid_header_height = grid_header.clientHeight + 1;
+     grid_row_height = grid_row.clientHeight + 1;
+   }
+
    if (getBrowserInfo('name').toUpperCase().indexOf("CHROME") != -1 || 
getBrowserInfo('name').toUpperCase().indexOf("SAFARI") != -1) {
      grid_header_height = grid_header_height + 1;
      grid_row_height = grid_row_height - 1;
diff -r 7e3737728bba -r 04147d5e6a99 web/js/utils.js
--- a/web/js/utils.js   Mon May 07 11:59:34 2012 +0200
+++ b/web/js/utils.js   Thu May 10 02:12:21 2012 +0200
@@ -26,6 +26,9 @@
  * Code that will be executed once the file is parsed
 */
 function utilsJSDirectExecution() {
+  if (navigator.userAgent.toUpperCase().indexOf("MSIE") !== -1 && 
getBrowserInfo('documentMode') >= 9 && parseInt(getBrowserInfo('majorVersion'), 
10) >= 9) {
+    isIE9Strict = true;
+  }
   isWindowInMDIPopup = checkWindowInMDIPopup();
   isWindowInMDITab = checkWindowInMDITab();
   isWindowInMDIPage = checkWindowInMDIPage();
@@ -33,9 +36,6 @@
   if (isWindowInMDIPage) {
     adaptSkinToMDIEnvironment();
   }
-  if (navigator.userAgent.toUpperCase().indexOf("MSIE") !== -1 && 
getBrowserInfo('documentMode') >= 9 && parseInt(getBrowserInfo('majorVersion'), 
10) >= 9) {
-    isIE9Strict = true;
-  }
 }
 
 var isIE9Strict = false;
@@ -246,7 +246,7 @@
 function getElementsByName(name, tag) {
   var resultArray = [];
   if (!tag || tag == "" || tag == null || typeof tag == "undefined") {
-    if (navigator.userAgent.toUpperCase().indexOf("MSIE") != -1 && 
!isIE9Strict) {
+    if (navigator.userAgent.toUpperCase().indexOf("MSIE") != -1) {
       var inputs = document.all;
       for (var i=0; i<inputs.length; i++){
         if (inputs.item(i).getAttribute('name') == name){
@@ -3400,6 +3400,9 @@
     addStyleRule(".Popup_ContentPane_SeparatorBar", "display: none;");
     addStyleRule(".Popup_ContentPane_CircleLogo", "display: none;");
   }
+  if (isIE9Strict) {
+    addStyleRule("th.DataGrid_Header_Cell", "height: 20px;");
+  }
 }
 
 /**

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to