Permalink
Browse files

Don't select row on double click

  • Loading branch information...
1 parent 7865695 commit 7015fd9706078bdc3cd3af5ff5010f08e05bfcab @vrana committed Oct 4, 2012
View
@@ -54,7 +54,7 @@
if ($_POST["search"] && $_POST["query"] != "") {
search_tables();
}
- echo "<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);'>\n";
+ echo "<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);">';
echo '<th>' . lang('Table');
echo '<td>' . lang('Engine');
@@ -29,7 +29,7 @@ function connect_error() {
$scheme = support("scheme");
$collations = collations();
echo "<form action='' method='post'>\n";
- echo "<table cellspacing='0' class='checkable' onclick='tableClick(event);'>\n";
+ echo "<table cellspacing='0' class='checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n";
echo "<thead><tr><td>&nbsp;<th>" . lang('Database') . "<td>" . lang('Collation') . "<td>" . lang('Tables') . "</thead>\n";
foreach ($databases as $db) {
$root = h(ME) . "db=" . urlencode($db);
@@ -13,7 +13,7 @@
?>
<form action="" method="post">
-<table cellspacing="0" onclick="tableClick(event);" class="nowrap checkable">
+<table cellspacing="0" onclick="tableClick(event);" ondblclick="tableClick(event, true);" class="nowrap checkable">
<?php
// HTML valid because there is always at least one process
$i = -1;
View
@@ -282,7 +282,7 @@
} else {
$backward_keys = $adminer->backwardKeys($TABLE, $table_name);
- echo "<table id='table' cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' onkeydown='return editingKeydown(event);'>\n";
+ echo "<table id='table' cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);' onkeydown='return editingKeydown(event);'>\n";
echo "<thead><tr>" . (!$group && $select ? "" : "<td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='" . h($_GET["modify"] ? remove_from_uri("modify") : $_SERVER["REQUEST_URI"] . "&modify=1") . "'>" . lang('edit') . "</a>");
$names = array();
$functions = array();
@@ -114,9 +114,10 @@ function formChecked(el, name) {
/** Select clicked row
* @param MouseEvent
+* @param [boolean] force click
*/
-function tableClick(event) {
- var click = (!window.getSelection || getSelection().isCollapsed);
+function tableClick(event, click) {
+ click = (click || !window.getSelection || getSelection().isCollapsed);
var el = event.target || event.srcElement;
while (!/^tr$/i.test(el.tagName)) {
if (/^(table|a|input|textarea)$/i.test(el.tagName)) {
@@ -130,7 +131,7 @@ function tableClick(event) {
}
el = el.firstChild.firstChild;
if (click) {
- el.click && el.click();
+ el.checked = !el.checked;
el.onclick && el.onclick();
}
trCheck(el);
View
@@ -1,5 +1,6 @@
Adminer 3.6.2-dev:
Edit values by Ctrl+click instead of double click
+Don't select row on double click
Shorten values in varchar fields
Display table default values on wide screens
Fix switching language on first load

0 comments on commit 7015fd9

Please sign in to comment.