[communityBranding] Fixes script in IE
authorIván Perdomo <ivan.perdomo@openbravo.com>
Fri, 22 Oct 2010 01:54:26 +0200
changeset 8742 e8e32dd85644
parent 8741 5c69ef7f3980
child 8743 999257edd433
[communityBranding] Fixes script in IE
- IE is reporting 'loaded' status instead of 'complete' therefore the callback
was never executed
- Small format changes (spaces instead of tab)
src/org/openbravo/erpCommon/utility/Home.html
--- a/src/org/openbravo/erpCommon/utility/Home.html	Thu Oct 21 18:38:18 2010 +0200
+++ b/src/org/openbravo/erpCommon/utility/Home.html	Fri Oct 22 01:54:26 2010 +0200
@@ -43,19 +43,20 @@
   }
 
   function getBranding() {
-	var utils = document.createElement('script'), s;
-	utils.type = 'text/javascript';
-	utils.src = document.location.protocol + butlerUtilsUrl;
+    var utils = document.createElement('script'), s;
+    utils.type = 'text/javascript';
     utils.onload = function() {
       setIframeUrl();
     };
     utils.onreadystatechange = function() { // IE
-      if(this.readyState == 'complete') {
+      if(this.readyState == 'complete' ||
+         this.readyState == 'loaded') {
         setIframeUrl();
       }
     };
-	s = document.getElementsByTagName('script')[0];
-	s.parentNode.insertBefore(utils, s);
+    utils.src = document.location.protocol + butlerUtilsUrl;
+    s = document.getElementsByTagName('script')[0];
+    s.parentNode.insertBefore(utils, s);
     setIframeUrl();
   }