From 57e5896b55acb974ae7b026bc55cea241c025fc5 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 29 Jul 2012 13:55:39 -0700 Subject: [PATCH] Autohide column context menu in select --- adminer/select.inc.php | 5 ++++- adminer/static/default.css | 1 + adminer/static/functions.js | 15 +++++++++++++++ changes.txt | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 3218799b..c429c34d 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -274,11 +274,14 @@ if (!$columns) { $rank++; $names[$key] = $name; $href = remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key); - echo '' . (!$select || $val ? apply_sql_function($val["fun"], $name) : h(current($select))) . ""; //! columns looking like functions + echo ''; + echo '' . (!$select || $val ? apply_sql_function($val["fun"], $name) : h(current($select))) . ""; //! columns looking like functions + echo ""; } $functions[$key] = $val["fun"]; next($select); diff --git a/adminer/static/default.css b/adminer/static/default.css index aa645eae..0351ee0c 100644 --- a/adminer/static/default.css +++ b/adminer/static/default.css @@ -23,6 +23,7 @@ pre { margin: 1em 0 0; } input[type=image] { vertical-align: middle; } .version { color: #777; font-size: 67%; } .js .hidden, .nojs .jsonly { display: none; } +.js .column { position: absolute; background: #ddf; padding: .3em 1ex .3em 0; margin-top: -.3em; } .nowrap td, .nowrap th, td.nowrap { white-space: pre; } .wrap td { white-space: normal; } .error { color: red; background: #fee; } diff --git a/adminer/static/functions.js b/adminer/static/functions.js index de31149e..5471d34d 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -278,6 +278,21 @@ function selectFieldChange(form) { +/** Toggles column context menu + * @param HTMLElement + * @param [string] extra class name + */ +function columnMouse(el, className) { + var spans = el.getElementsByTagName('span'); + for (var i=0; i < spans.length; i++) { + if (/column/.test(spans[i].className)) { + spans[i].className = 'column' + (className || ''); + } + } +} + + + /** Fill column in search field * @param string */ diff --git a/changes.txt b/changes.txt index a975d69d..820bb863 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,6 @@ Adminer 3.4.1-dev: Links for column search in select +Autohide column context menu in select Display assigned auto_increment after clone SQLite: Full alter table SQLite: Better editing in tables without primary key