Autohide column context menu in select
This commit is contained in:
parent
ac668d1331
commit
57e5896b55
|
@ -274,11 +274,14 @@ if (!$columns) {
|
||||||
$rank++;
|
$rank++;
|
||||||
$names[$key] = $name;
|
$names[$key] = $name;
|
||||||
$href = remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key);
|
$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>";
|
echo "<a href='" . h("$href&desc%5B0%5D=1") . "' title='" . lang('descending') . "' class='text'> ↓</a>";
|
||||||
if (!$val["fun"]) {
|
if (!$val["fun"]) {
|
||||||
echo '<a href="#fieldset-search" onclick="selectSearch(\'' . h(js_escape($key)) . '\'); return false;" title="' . lang('Search') . '" class="text jsonly"> =</a>';
|
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"];
|
$functions[$key] = $val["fun"];
|
||||||
next($select);
|
next($select);
|
||||||
|
|
|
@ -23,6 +23,7 @@ pre { margin: 1em 0 0; }
|
||||||
input[type=image] { vertical-align: middle; }
|
input[type=image] { vertical-align: middle; }
|
||||||
.version { color: #777; font-size: 67%; }
|
.version { color: #777; font-size: 67%; }
|
||||||
.js .hidden, .nojs .jsonly { display: none; }
|
.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; }
|
.nowrap td, .nowrap th, td.nowrap { white-space: pre; }
|
||||||
.wrap td { white-space: normal; }
|
.wrap td { white-space: normal; }
|
||||||
.error { color: red; background: #fee; }
|
.error { color: red; background: #fee; }
|
||||||
|
|
|
@ -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
|
/** Fill column in search field
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
Adminer 3.4.1-dev:
|
Adminer 3.4.1-dev:
|
||||||
Links for column search in select
|
Links for column search in select
|
||||||
|
Autohide column context menu in select
|
||||||
Display assigned auto_increment after clone
|
Display assigned auto_increment after clone
|
||||||
SQLite: Full alter table
|
SQLite: Full alter table
|
||||||
SQLite: Better editing in tables without primary key
|
SQLite: Better editing in tables without primary key
|
||||||
|
|
Loading…
Reference in a new issue