diff options
author | Warren Baker <warren@decoy.co.za> | 2010-09-15 14:32:25 +0200 |
---|---|---|
committer | Warren Baker <warren@decoy.co.za> | 2010-09-15 14:32:25 +0200 |
commit | cf6a1f80e8ec88b0393f925f44ce525bef0d2850 (patch) | |
tree | 957546127a8eb37e6d64901123f57a95482c4d74 /usr/local/www | |
parent | c9cb32c4a302ebbfd1bfcc18050389cae47413cf (diff) | |
download | pfsense-cf6a1f80e8ec88b0393f925f44ce525bef0d2850.zip pfsense-cf6a1f80e8ec88b0393f925f44ce525bef0d2850.tar.gz |
Change windows.onLoad event to rely on DOM readiness instead, for enablechange() function. Tested on Safari, Chrome, FFox and IE7+8 on windows and OSX.
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/pkg_edit.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index c7a444b..015c6fb 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -261,10 +261,28 @@ if ($pkg['custom_php_after_head_command']) ?> -<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onLoad="enablechange();"> +<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> <?php if($pkg['fields']['field'] <> "") { ?> <script language="JavaScript"> <!-- + + window.onDomReady = DomReady; + function DomReady(fn) { + if(document.addEventListener) { //W3C + document.addEventListener("DOMContentLoaded", fn, false); + } else { // IE + document.onreadystatechange = function(){readyState(fn)} + } + } + function readyState(fn) { + //dom is ready for interaction + if(document.readyState == "complete") { + fn(); + } + } + + window.onDomReady(enablechange); + function enablechange() { <?php foreach ($pkg['fields']['field'] as $field) { |