Fixed issue 20481: 'Drag and drop' popup now is well rendered in IE9 + HTML5
authorDavid Baz Fayos <david.baz@openbravo.com>
Sun, 13 May 2012 23:34:44 +0200
changeset 16504 e08294a7f372
parent 16503 bebb88e36e56
child 16505 fae3a9d99ec8
Fixed issue 20481: 'Drag and drop' popup now is well rendered in IE9 + HTML5
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
src/org/openbravo/erpCommon/utility/WindowTree.html
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js	Sun May 13 21:10:58 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js	Sun May 13 23:34:44 2012 +0200
@@ -1654,7 +1654,12 @@
     var popupParams = 'Command=DEFAULT';
     popupParams += '&inpTabId=' + tabId;
     popupParams += '&hideMenu=true&noprefs=true';
-    OB.Layout.ClassicOBCompatibility.Popup.open('tree', 750, 625, OB.Application.contextUrl + 'utility/WindowTree.html?' + popupParams, '', window, true, true, true, null, false);
+
+    if (OB.Utilities.isIE9Strict) { // Drag and drop tree is not well rendered with IE9 + HTML5, so it should be opened in an isolated popup
+      OB.Utilities.openProcessPopup(OB.Application.contextUrl + 'utility/WindowTree.html?' + popupParams, true, null, 670, 750);
+    } else {
+      OB.Layout.ClassicOBCompatibility.Popup.open('tree', 750, 625, OB.Application.contextUrl + 'utility/WindowTree.html?' + popupParams, '', window, true, true, true, null, false);
+    }
   }
 
   view.setContextInfo(view.getContextInfo(true, true, true, true), openPopupTree, true);
--- a/src/org/openbravo/erpCommon/utility/WindowTree.html	Sun May 13 21:10:58 2012 +0200
+++ b/src/org/openbravo/erpCommon/utility/WindowTree.html	Sun May 13 23:34:44 2012 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -170,8 +170,16 @@
       var topAreaContainer = document.getElementById("topArea");
       var bottomAreaContainer = document.getElementById("bottomArea");
       var menuAreaContainer = document.getElementById("openbravo_tree");
-      var windowHeight = document.getElementsByTagName("BODY")[0].clientHeight;
-      menuAreaContainer.style.height = windowHeight - topAreaContainer.clientHeight - bottomAreaContainer.clientHeight;
+      var body = document.getElementsByTagName("BODY");
+      var windowHeight;
+      if (isIE9Strict) {
+        windowHeight = window.innerHeight;
+      } else {
+        windowHeight = body[0].clientHeight;
+      }
+      var menuAreaContainerHeight = windowHeight - topAreaContainer.clientHeight - bottomAreaContainer.clientHeight;
+      if (menuAreaContainerHeight < 0) { menuAreaContainerHeight = 0; }
+      menuAreaContainer.style.height = menuAreaContainerHeight;
     }
   </script>
 <script language="JavaScript" type="text/javascript">