]> git.mjollnir.org Git - moodle.git/commitdiff
Attention to detail: this prevents generating a warning if $focus is not set.
authordefacer <defacer>
Mon, 23 Aug 2004 08:34:51 +0000 (08:34 +0000)
committerdefacer <defacer>
Mon, 23 Aug 2004 08:34:51 +0000 (08:34 +0000)
Of course, the warning is hidden inside JS and thus invisible to the naked eye.

lib/javascript.php

index 22fbf70eab28a846e657bc2da3cc5d02509ad852..31055f09039e810e3da12183e7c44edf885602fb 100644 (file)
@@ -92,7 +92,7 @@ function unlockoption(form,item) {
   eval("document."+form+".h"+item+".value=0");
 }
 
-<?php if ($focus) { echo "function setfocus() { document.$focus.focus() }\n"; } ?>
+<?php if (!empty($focus)) { echo "function setfocus() { document.$focus.focus() }\n"; } ?>
 
 // done hiding -->