]> git.joonet.de Git - adminer.git/commitdiff
Avoid JS error with empty table
authorJakub Vrana <jakub@vrana.cz>
Thu, 17 Mar 2011 09:10:27 +0000 (10:10 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 17 Mar 2011 09:10:27 +0000 (10:10 +0100)
adminer/edit.inc.php

index 5854b958cea3db9b540de64c052dd848ac059413..c195cd7b6a01e03b28858feddae471c86efc5904 100644 (file)
@@ -98,7 +98,7 @@ if ($fields) {
        }
 }
 echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\">\n"
-       : ($_POST ? "" : "<script type='text/javascript'>document.getElementById('form').getElementsByTagName('td')[1].firstChild.focus();</script>\n")
+       : ($_POST || !$fields ? "" : "<script type='text/javascript'>document.getElementById('form').getElementsByTagName('td')[1].firstChild.focus();</script>\n")
 );
 if (isset($_GET["select"])) {
        hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"]));