Autohide column context menu in select

This commit is contained in:
Jakub Vrana 2012-07-29 13:55:39 -07:00
parent ac668d1331
commit 57e5896b55
4 changed files with 21 additions and 1 deletions

View file

@ -274,11 +274,14 @@ if (!$columns) {
$rank++;
$names[$key] = $name;
$href = remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key);
echo '<th><a href="' . h($href) . '">' . (!$select || $val ? apply_sql_function($val["fun"], $name) : h(current($select))) . "</a>"; //! columns looking like functions
echo '<th onmouseover="columnMouse(this);" onmouseout="columnMouse(this, \' hidden\');">';
echo '<a href="' . h($href) . '">' . (!$select || $val ? apply_sql_function($val["fun"], $name) : h(current($select))) . "</a>"; //! columns looking like functions
echo "<span class='column hidden'>";
echo "<a href='" . h("$href&desc%5B0%5D=1") . "' title='" . lang('descending') . "' class='text'> ↓</a>";
if (!$val["fun"]) {
echo '<a href="#fieldset-search" onclick="selectSearch(\'' . h(js_escape($key)) . '\'); return false;" title="' . lang('Search') . '" class="text jsonly"> =</a>';
}
echo "</span>";
}
$functions[$key] = $val["fun"];
next($select);

View file

@ -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; }

View file

@ -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
*/

View file

@ -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