[Vtigercrm-commits] [vtiger-commits] r6428 - in /vtigercrm/trunk: include/js/general.js modules/Emails/EditView.php modules/Webmails/EditView.php modules/Webmails/ListView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu May 25 12:34:34 EDT 2006


Author: mmbrich
Date: Thu May 25 10:34:33 2006
New Revision: 6428

Log:
added new window.onload handler function so no onload listeners are overwritten

Modified:
    vtigercrm/trunk/include/js/general.js
    vtigercrm/trunk/modules/Emails/EditView.php
    vtigercrm/trunk/modules/Webmails/EditView.php
    vtigercrm/trunk/modules/Webmails/ListView.php

Modified: vtigercrm/trunk/include/js/general.js
==============================================================================
--- vtigercrm/trunk/include/js/general.js (original)
+++ vtigercrm/trunk/include/js/general.js Thu May 25 10:34:33 2006
@@ -1559,3 +1559,23 @@
        menu_max = menu_max -5;
    }
 }
+
+function addOnloadEvent(fnc){
+  if ( typeof window.addEventListener != "undefined" )
+    window.addEventListener( "load", fnc, false );
+  else if ( typeof window.attachEvent != "undefined" ) {
+    window.attachEvent( "onload", fnc );
+  }
+  else {
+    if ( window.onload != null ) {
+      var oldOnload = window.onload;
+      window.onload = function ( e ) {
+        oldOnload( e );
+        window[fnc]();
+      };
+    }
+    else
+      window.onload = fnc;
+  }
+}
+

Modified: vtigercrm/trunk/modules/Emails/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/EditView.php (original)
+++ vtigercrm/trunk/modules/Emails/EditView.php Thu May 25 10:34:33 2006
@@ -251,12 +251,12 @@
 $smarty->display("ComposeEmail.tpl");
 ?>
 <script type="text/javascript" defer="1">
-window.onload = function () {
+addOnloadEvent(function () {
 var oFCKeditor = null;
 oFCKeditor = new FCKeditor( "description" ) ;
 oFCKeditor.BasePath  = "include/fckeditor/" ;
 oFCKeditor.Height = 500;
 oFCKeditor.Width = "100%";
 oFCKeditor.ReplaceTextarea() ;
-}
+});
 </script>

Modified: vtigercrm/trunk/modules/Webmails/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/EditView.php (original)
+++ vtigercrm/trunk/modules/Webmails/EditView.php Thu May 25 10:34:33 2006
@@ -175,14 +175,14 @@
 
 ?>
 <script type="text/javascript" defer="1">
-window.onload = function () {
+addOnloadEvent(function () {
 var oFCKeditor = null;
 oFCKeditor = new FCKeditor( "email_body" ) ;
 oFCKeditor.BasePath  = "include/fckeditor/" ;
 oFCKeditor.Height = 550;
 oFCKeditor.Width = "100%";
 oFCKeditor.ReplaceTextarea() ;
-}
+});
 </script>
 <?
 

Modified: vtigercrm/trunk/modules/Webmails/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/ListView.php (original)
+++ vtigercrm/trunk/modules/Webmails/ListView.php Thu May 25 10:34:33 2006
@@ -146,7 +146,7 @@
 
 <script type="text/Javascript">
 var box_refresh=<?php echo $box_refresh;?>;
-var timer = window.onload=window.setTimeout("check_for_new_mail()",box_refresh);
+var timer = addOnloadEvent(window.setTimeout("check_for_new_mail()",box_refresh));
 
 var command;
 var id;





More information about the vtigercrm-commits mailing list