summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorWarren Baker <warren@decoy.co.za>2010-09-15 14:32:25 +0200
committerWarren Baker <warren@decoy.co.za>2010-09-15 14:32:25 +0200
commitcf6a1f80e8ec88b0393f925f44ce525bef0d2850 (patch)
tree957546127a8eb37e6d64901123f57a95482c4d74 /usr/local/www
parentc9cb32c4a302ebbfd1bfcc18050389cae47413cf (diff)
downloadpfsense-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-xusr/local/www/pkg_edit.php20
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) {
OpenPOWER on IntegriCloud