Related to issue 20207: 'Loading' popups works ok again in IE9 + HTML5
authorDavid Baz Fayos <david.baz@openbravo.com>
Mon, 14 May 2012 04:06:09 +0200
changeset 16507 4914bc66fa28
parent 16506 408a83fb81ae
child 16508 15df713b1e43
Related to issue 20207: 'Loading' popups works ok again in IE9 + HTML5
- Improved version
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
src/org/openbravo/erpCommon/ad_process/ApplyModules.html
src/org/openbravo/erpCommon/utility/PopupLoading.html
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js	Mon May 14 03:07:09 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js	Mon May 14 04:06:09 2012 +0200
@@ -428,18 +428,16 @@
             if (OB.Utilities.isIE9Strict) {
               // In IE9 Strict, when the location.href or .src is defined, the previous defined opener is lost, and it should be defined again
               cPopup.getIframeHtmlObj().contentWindow.frames[0].opener = cPopup.theOpener;
-              var nu = 0;
               var setOpenerInterval;
               setOpenerInterval = setInterval(
 
               function () {
-                if (cPopup.getIframeHtmlObj().contentWindow.frames[0].document.readyState === 'complete' || nu === 30000) {
+                if (!cPopup.getIframeHtmlObj()) {
+                  clearInterval(setOpenerInterval);
+                } else if (cPopup.getIframeHtmlObj().contentWindow.frames[0].document.readyState === 'complete' && !cPopup.getIframeHtmlObj().contentWindow.frames[0].opener) {
                   cPopup.getIframeHtmlObj().contentWindow.frames[0].opener = cPopup.theOpener;
-                  clearInterval(setOpenerInterval);
-                } else {
-                  nu++;
                 }
-              }, 1);
+              }, 100);
             }
           } else {
             // Create a form and POST parameters as input hidden values
--- a/src/org/openbravo/erpCommon/ad_process/ApplyModules.html	Mon May 14 03:07:09 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ApplyModules.html	Mon May 14 04:06:09 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) 2008-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -734,7 +734,7 @@
            
 
               <tr><td colspan="4">
-                <div style="overflow: auto; width: 600px;">
+                <div style="overflow: hidden; width: 600px;">
                   <span id="rebuildMessage" class="CheckList_RebuildSystemWindow_title">Elapsed time: <span id="localTimer">00:00</span>.</br> Do not close this window.</span>
                  </div>
               </td></tr>
@@ -743,7 +743,7 @@
     <tr><td><table class="Popup_Client_TablePopup" cellpadding="0" cellspacing="0" id="restartOptions" style="margin-top: 5px;">
               
               <tr><td colspan="2">
-                <div style="overflow: auto; width: 600px;">
+                <div style="overflow: hidden; width: 600px;">
                   <span class="PlainText_normal">In order for the changes to take effect, you need to restart the servlet container.</span>
                 </div>
               </td></tr>
@@ -811,7 +811,7 @@
               </td></tr>
 
               <tr><td colspan="4">
-                <div style="overflow: auto; width: 600px;">
+                <div style="overflow: hidden; width: 600px;">
                   <span class="CheckList_RebuildSystemWindow_title">Warnings and errors:</span>
                 </div>
               </td></tr>
--- a/src/org/openbravo/erpCommon/utility/PopupLoading.html	Mon May 14 03:07:09 2012 +0200
+++ b/src/org/openbravo/erpCommon/utility/PopupLoading.html	Mon May 14 04:06:09 2012 +0200
@@ -38,16 +38,20 @@
   <script language="javascript">
     function onLoadDo() {
       moreOnLoadDoFunctions();
-      var i=0;
-      var setOpenerInterval = setInterval(
-        function() {
-          if (window.opener || i === 30000) {
-            window.opener.setPopupLoadingWindowLoaded(true);
-            clearInterval(setOpenerInterval);
-          } else {
-            i++;
-          }
-        }, 10);
+      if (isIE9Strict) {
+        var i=0;
+        var setOpenerInterval = setInterval(
+          function() {
+            if (window.opener || i === 30000) {
+              window.opener.setPopupLoadingWindowLoaded(true);
+              clearInterval(setOpenerInterval);
+            } else {
+              i++;
+            }
+          }, 200);
+      } else {
+        window.opener.setPopupLoadingWindowLoaded(true);
+      }
       return true;
     }
   </script>