Reveal menu items only if mouse is over wide links
This commit is contained in:
parent
beafccb8c3
commit
5d337fe04c
|
@ -785,7 +785,7 @@ DROP PROCEDURE adminer_alter;
|
||||||
foreach ($usernames as $username => $password) {
|
foreach ($usernames as $username => $password) {
|
||||||
if ($password !== null) {
|
if ($password !== null) {
|
||||||
if ($first) {
|
if ($first) {
|
||||||
echo "<p id='logins' onmouseover='menuOver(this);' onmouseout='menuOut(this);'>\n";
|
echo "<p id='logins' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
|
||||||
$first = false;
|
$first = false;
|
||||||
}
|
}
|
||||||
echo "<a href='" . h(auth_url($driver, $server, $username)) . "'>($drivers[$driver]) " . h($username . ($server != "" ? "@$server" : "")) . "</a><br>\n";
|
echo "<a href='" . h(auth_url($driver, $server, $username)) . "'>($drivers[$driver]) " . h($username . ($server != "" ? "@$server" : "")) . "</a><br>\n";
|
||||||
|
@ -867,7 +867,7 @@ DROP PROCEDURE adminer_alter;
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function tablesPrint($tables) {
|
function tablesPrint($tables) {
|
||||||
echo "<p id='tables' onmouseover='menuOver(this);' onmouseout='menuOut(this);'>\n";
|
echo "<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
|
||||||
foreach ($tables as $table => $type) {
|
foreach ($tables as $table => $type) {
|
||||||
echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> ";
|
echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> ";
|
||||||
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . " title='" . lang('Show structure') . "'>" . $this->tableName(array("Name" => $table)) . "</a><br>\n"; //! Adminer::tableName may work with full table status
|
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . " title='" . lang('Show structure') . "'>" . $this->tableName(array("Name" => $table)) . "</a><br>\n"; //! Adminer::tableName may work with full table status
|
||||||
|
|
|
@ -209,10 +209,22 @@ function pageClick(href, page, event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function menuOver(el) {
|
|
||||||
|
|
||||||
|
/** Display items in menu
|
||||||
|
* @param HTMLElement
|
||||||
|
* @param MouseEvent
|
||||||
|
*/
|
||||||
|
function menuOver(el, event) {
|
||||||
|
var a = event.target;
|
||||||
|
if (/^a$/i.test(a.tagName) && a.offsetLeft + a.offsetWidth > a.parentNode.offsetWidth) {
|
||||||
el.style.overflow = 'visible';
|
el.style.overflow = 'visible';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Hide items in menu
|
||||||
|
* @param HTMLElement
|
||||||
|
*/
|
||||||
function menuOut(el) {
|
function menuOut(el) {
|
||||||
el.style.overflow = 'auto';
|
el.style.overflow = 'auto';
|
||||||
}
|
}
|
||||||
|
|
|
@ -538,7 +538,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
||||||
foreach ((array) $_SESSION["pwds"]["server"][""] as $username => $password) {
|
foreach ((array) $_SESSION["pwds"]["server"][""] as $username => $password) {
|
||||||
if ($password !== null) {
|
if ($password !== null) {
|
||||||
if ($first) {
|
if ($first) {
|
||||||
echo "<p id='logins' onmouseover='menuOver(this);' onmouseout='menuOut(this);'>\n";
|
echo "<p id='logins' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
|
||||||
$first = false;
|
$first = false;
|
||||||
}
|
}
|
||||||
echo "<a href='" . h(auth_url("server", "", $username)) . "'>" . ($username != "" ? h($username) : "<i>" . lang('empty') . "</i>") . "</a><br>\n";
|
echo "<a href='" . h(auth_url("server", "", $username)) . "'>" . ($username != "" ? h($username) : "<i>" . lang('empty') . "</i>") . "</a><br>\n";
|
||||||
|
@ -569,7 +569,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
||||||
}
|
}
|
||||||
|
|
||||||
function tablesPrint($tables) {
|
function tablesPrint($tables) {
|
||||||
echo "<p id='tables' onmouseover='menuOver(this);' onmouseout='menuOut(this);'>\n";
|
echo "<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
|
||||||
foreach ($tables as $row) {
|
foreach ($tables as $row) {
|
||||||
$name = $this->tableName($row);
|
$name = $this->tableName($row);
|
||||||
if (isset($row["Engine"]) && $name != "") { // ignore views and tables without name
|
if (isset($row["Engine"]) && $name != "") { // ignore views and tables without name
|
||||||
|
|
|
@ -23,7 +23,7 @@ function tablesFilter(value) {
|
||||||
</script>
|
</script>
|
||||||
<p class="jsonly"><input onkeyup="tablesFilter(this.value);">
|
<p class="jsonly"><input onkeyup="tablesFilter(this.value);">
|
||||||
<?php
|
<?php
|
||||||
echo "<p id='tables' onmouseover='menuOver(this);' onmouseout='menuOut(this);'>\n";
|
echo "<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
|
||||||
foreach ($tables as $table => $type) {
|
foreach ($tables as $table => $type) {
|
||||||
echo '<span><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> ";
|
echo '<span><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> ";
|
||||||
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . ">" . h($table) . "</a><br></span>\n";
|
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . ">" . h($table) . "</a><br></span>\n";
|
||||||
|
|
Loading…
Reference in a new issue