]> git.joonet.de Git - adminer.git/commitdiff
Define JS functions in AdminerTablesFilter sooner
authorJakub Vrana <jakub@vrana.cz>
Fri, 19 Jan 2018 09:55:51 +0000 (10:55 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 19 Jan 2018 09:55:51 +0000 (10:55 +0100)
adminer/static/functions.js
plugins/tables-filter.php

index 8a575781553174fddec095f25335af59e6249ee6..b3c85ca4c197cd0b36a3f8abe2b2411297a187b2 100644 (file)
@@ -823,6 +823,9 @@ function findDefaultSubmit(el) {
        if (el.jushTextarea) {
                el = el.jushTextarea;
        }
+       if (!el.form) {
+               return null;
+       }
        var inputs = qsa('input', el.form);
        for (var i = 0; i < inputs.length; i++) {
                var input = inputs[i];
index 240841cb59dbf90eb391303d45d09fdc3a68c3f0..c446af20c68abf4310cdf0dc38870a2e594d2692 100644 (file)
@@ -8,22 +8,6 @@
 */
 class AdminerTablesFilter {
        function tablesPrint($tables) { ?>
-<p class="jsonly"><input id="filter-field" autocomplete="off"><?php echo script("qs('#filter-field').oninput = tablesFilterInput;"); ?>
-<ul id='tables'>
-<?php
-echo script("mixin(qs('#tables'), {onmouseover: menuOver, onmouseout: menuOut});");
-foreach ($tables as $table => $status) {
-       echo '<li data-table-name="' . h($table) . '"><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select") . ">" . lang('select') . "</a> ";
-       $name = h($status["Name"]);
-       echo (support("table") || support("indexes")
-               ? '<a href="' . h(ME) . 'table=' . urlencode($table) . '"'
-                       . bold(in_array($table, array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"])), (is_view($status) ? "view" : "structure"))
-                       . " title='" . lang('Show structure') . "'>$name</a>"
-               : "<span>$name</span>"
-       ) . "\n";
-}
-?>
-</ul>
 <script<?php echo nonce(); ?>>
 var tablesFilterTimeout = null;
 var tablesFilterValue = '';
@@ -70,6 +54,22 @@ if (sessionStorage){
        sessionStorage.setItem('adminer_tables_filter_db', db);
 }
 </script>
+<p class="jsonly"><input id="filter-field" autocomplete="off"><?php echo script("qs('#filter-field').oninput = tablesFilterInput;"); ?>
+<ul id='tables'>
+<?php
+echo script("mixin(qs('#tables'), {onmouseover: menuOver, onmouseout: menuOut});");
+foreach ($tables as $table => $status) {
+       echo '<li data-table-name="' . h($table) . '"><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select") . ">" . lang('select') . "</a> ";
+       $name = h($status["Name"]);
+       echo (support("table") || support("indexes")
+               ? '<a href="' . h(ME) . 'table=' . urlencode($table) . '"'
+                       . bold(in_array($table, array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"])), (is_view($status) ? "view" : "structure"))
+                       . " title='" . lang('Show structure') . "'>$name</a>"
+               : "<span>$name</span>"
+       ) . "\n";
+}
+?>
+</ul>
 <?php
                return true;
        }