details:   https://code.openbravo.com/erp/devel/pi/rev/bebb88e36e56
changeset: 16503:bebb88e36e56
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Sun May 13 21:10:58 2012 +0200
summary:   Related to issue 20480: Proper function definition

details:   https://code.openbravo.com/erp/devel/pi/rev/e08294a7f372
changeset: 16504:e08294a7f372
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Sun May 13 23:34:44 2012 +0200
summary:   Fixed issue 20481: 'Drag and drop' popup now is well rendered in IE9 
+ HTML5

details:   https://code.openbravo.com/erp/devel/pi/rev/fae3a9d99ec8
changeset: 16505:fae3a9d99ec8
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Sun May 13 23:35:37 2012 +0200
summary:   merge

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
 |   8 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
                |  32 ++-------
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
               |   7 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
           |   5 +
 src/org/openbravo/erpCommon/utility/WindowTree.html                            
                                      |  14 +++-
 5 files changed, 32 insertions(+), 34 deletions(-)

diffs (142 lines):

diff -r 791f143310a1 -r fae3a9d99ec8 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
      Sat May 12 16:52:38 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
      Sun May 13 23:35:37 2012 +0200
@@ -363,12 +363,8 @@
         if (isModal !== false) {
           isModal = true;
         }
-        var _htmlCode, _isIE9Strict = false,
-            _navUserAgent = navigator.userAgent.toUpperCase();
-        if (_navUserAgent.indexOf("MSIE") !== -1 && (document.documentMode && 
document.documentMode >= 9)) {
-          _isIE9Strict = true;
-        }
-        if (_isIE9Strict || _navUserAgent.indexOf("MSIE") === -1) { // IE >= 9 
(Strict) or any other browser
+        var _htmlCode, _navUserAgent = navigator.userAgent.toUpperCase();
+        if (OB.Utilities.isIE9Strict || _navUserAgent.indexOf("MSIE") === -1) 
{ // IE >= 9 (Strict) or any other browser
           _htmlCode = '<html><head></head><body style="margin: 0; padding: 0; 
border: none;">' + '<iframe id="MDIPopupContainer" name="MDIPopupContainer" 
style="margin: 0; padding: 0; border: none; width: 100%; height: 
100%;"></iframe>' + '<iframe name="frameMenu" scrolling="no" src="' + 
OB.Application.contextUrl + 'utility/VerticalMenu.html?Command=HIDE" 
id="paramFrameMenuLoading" style="margin: 0px; padding: 0px; border: 0px; 
height: 0px; width: 0px;"></iframe>' + '</body></html>';
         } else { // IE <= 8
           _htmlCode = '<html><head></head><frameset cols="*, 0%" rows="*" 
frameborder="no" border="0" framespacing="0">' + '<frame id="MDIPopupContainer" 
name="MDIPopupContainer"></frame>' + '<frame name="frameMenu" scrolling="no" 
src="' + OB.Application.contextUrl + 'utility/VerticalMenu.html?Command=HIDE" 
id="paramFrameMenuLoading"></frame>' + '</frameset><body></body></html>';
diff -r 791f143310a1 -r fae3a9d99ec8 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
     Sat May 12 16:52:38 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
     Sun May 13 23:35:37 2012 +0200
@@ -2054,33 +2054,17 @@
       this.view.standardWindow.doActionAfterAutoSave(actionObject, true);
       return;
     }
-    if (ficCallDone) {
-      // get new value as the row can have changed
-      this.Super('cellEditEnd', [editCompletionEvent, 
this.getEditValue(rowNum, colNum)]);
-      return;
-    } else {
-      // only needed for non picklist fields
-      // as picklist fields will always have picked a value
-      // note that focusItem updatevalue for picklist can result in extra 
datasource requests
-      if (focusItem && !focusItem.hasPickList) {
-        focusItem.blur(focusItem.form, focusItem);
-        if (editForm.inFicCall) {
-          // use editValues object as the edit form will be re-used for a next 
row
-          var editValues = this.getEditValues(rowNum);
-          editValues.actionAfterFicReturn = {
-            target: this,
-            method: this.cellEditEnd,
-            parameters: [editCompletionEvent, newValue, true, autoSaveDone]
-          };
-          return;
-        }
-      }
-    }
     if (newValue) {
       this.Super('cellEditEnd', [editCompletionEvent, newValue]);
     } else {
       this.Super('cellEditEnd', [editCompletionEvent]);
     }
+    // only needed for non picklist fields
+    // as picklist fields will always have picked a value
+    // note that focusItem updatevalue for picklist can result in extra 
datasource requests
+    if (focusItem && !focusItem.hasPickList) {
+      focusItem.blur(focusItem.form, focusItem);
+    }
   },
 
   // overridden to set the enterkeyaction to nextrowstart in cases the current 
row
@@ -2164,7 +2148,7 @@
 
     if (ficCallDone) {
       // reset the new values as this can have changed because of a fic call
-      newValues = this.getEditValues(editValuesID);
+      newValues = this.getEditValues(rowNum);
     } else {
       var editForm = this.getEditForm(),
           focusItem = editForm.getFocusItem();
@@ -2172,7 +2156,7 @@
         focusItem.blur(focusItem.form, focusItem);
         if (editForm.inFicCall) {
           // use editValues object as the edit form will be re-used for a next 
row
-          var editValues = this.getEditValues(editValuesID);
+          var editValues = this.getEditValues(rowNum);
           editValues.actionAfterFicReturn = {
             target: this,
             method: this.saveEditedValues,
diff -r 791f143310a1 -r fae3a9d99ec8 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
    Sat May 12 16:52:38 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
    Sun May 13 23:35:37 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);
diff -r 791f143310a1 -r fae3a9d99ec8 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
        Sat May 12 16:52:38 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
        Sun May 13 23:35:37 2012 +0200
@@ -22,6 +22,11 @@
 // are related to opening views, opening popups, displaying yes/no, etc. 
 OB.Utilities = {};
 
+OB.Utilities.isIE9Strict = false;
+if (navigator.userAgent.toUpperCase().indexOf("MSIE") !== -1 && 
(document.documentMode && document.documentMode >= 9)) {
+  OB.Utilities.isIE9Strict = true;
+}
+
 //** {{{OB.Utilities.checkProfessionalLicense}}} **
 // Checks if the current instance is using a professional license 
 // (!= community). If the instance has a community instance then 
diff -r 791f143310a1 -r fae3a9d99ec8 
src/org/openbravo/erpCommon/utility/WindowTree.html
--- a/src/org/openbravo/erpCommon/utility/WindowTree.html       Sat May 12 
16:52:38 2012 +0200
+++ b/src/org/openbravo/erpCommon/utility/WindowTree.html       Sun May 13 
23:35:37 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">

------------------------------------------------------------------------------
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