details:   /erp/devel/pi/rev/d38c8af3fc43
changeset: 10685:d38c8af3fc43
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Wed Feb 16 01:30:12 2011 +0100
summary:   Now OB works again in IE7 and IE8

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
 |  30 +++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diffs (46 lines):

diff -r 0c0137e7a99b -r d38c8af3fc43 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
  Tue Feb 15 22:35:27 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
  Wed Feb 16 01:30:12 2011 +0100
@@ -79,13 +79,41 @@
 // If action is null/undefined then nothing is done and undefined is returned.
 // When the action is called the result of the action is returned.
 OB.Utilities.callAction = function(action){
+  function IEApplyHack(method, object, parameters) {
+    if (!object) {
+      object = window;
+    }
+    if (!parameters) {
+      parameters = [];
+    }
+
+    object.customApplyMethod = method;
+
+    var argsString = [];
+    for(var i = 0; i < parameters.length; i++) {
+      argsString[i] = 'parameters[' + i + ']';
+    }
+
+    var argsList = argsString.join(",");
+
+    var result = eval('object.customApplyMethod(' + argsList + ');');
+
+    delete object.customApplyMethod;
+
+    return result;
+  }
+
   if (!action) {
     return;
   }
   if (action.callback) {
     action.callback();
   } else {
-    action.method.apply(action.target, action.parameters);
+    if (navigator.userAgent.toUpperCase().indexOf("MSIE") !== -1) {
+      IEApplyHack(action.method, action.target, action.parameters);
+    } else {
+      action.method.apply(action.target, action.parameters);
+    }
   }
 };
 

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to