Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Send select search form by Enter on <select>

  • Loading branch information...
commit 5586c51d18e7c6131474b2fa74dda38b4917907f 1 parent 266d832
@vrana authored
View
2  adminer/select.inc.php
@@ -196,7 +196,7 @@
if (!$columns) {
echo "<p class='error'>" . lang('Unable to select the table') . ($fields ? "." : ": " . error()) . "\n";
} else {
- echo "<form action='' id='form'>\n";
+ echo "<form action='' id='form' onkeydown='searchKeydown(this, event);'>\n";
echo "<div style='display: none;'>";
hidden_fields_get();
echo (DB != "" ? '<input type="hidden" name="db" value="' . h(DB) . '">' . (isset($_GET["ns"]) ? '<input type="hidden" name="ns" value="' . h($_GET["ns"]) . '">' : "") : ""); // not used in Editor
View
11 adminer/static/functions.js
@@ -201,6 +201,17 @@ function textareaKeydown(target, event, tab, button) {
return true;
}
+/** Send form by Enter on <select>
+* @param HTMLFormElement
+* @param KeyboardEvent
+*/
+function searchKeydown(form, event) {
+ var target = event.target || event.srcElement;
+ if (/select/i.test(target.tagName) && (event.keyCode == 13 || event.keyCode == 10)) { // shiftKey and rest allowed
+ form.submit();
+ }
+}
+
/** Change focus by Ctrl+Up or Ctrl+Down
View
1  changes.txt
@@ -3,6 +3,7 @@ Ability to save expression in edit
Respect default database collation (bug #3191489)
Don't export triggers without table (bug #3193489)
Esc to focus next field in Tab textarea (thanks to David Grudl)
+Send select search form by Enter on <select>
Enum editor and textarea Ctrl+Enter working in IE
AJAX forms in Google Chrome
Parse UTF-16 and UTF-8 BOM in all text uploads
Please sign in to comment.
Something went wrong with that request. Please try again.