1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-27 08:14:35 +02:00

Display help in tooltip

Also rename Analyze to Vacuum outside MySQL
This commit is contained in:
Jakub Vrana
2013-07-19 10:35:31 -07:00
parent b8ece2fb5d
commit a338f9bf58
10 changed files with 65 additions and 41 deletions

View File

@@ -68,6 +68,7 @@ input.required { box-shadow: 1px 1px 1px red; }
#schema { margin-left: 60px; position: relative; -moz-user-select: none; -webkit-user-select: none; }
#schema .table { border: 1px solid silver; padding: 0 2px; cursor: move; position: absolute; }
#schema .references { position: absolute; }
#help { position: absolute; border: 1px solid #999; background: #eee; padding: 5px; font-family: monospace; z-index: 1; }
.rtl h2 { margin: 0 -18px 20px 0; }
.rtl p, .rtl table, .rtl .error, .rtl .message { margin: 1em 0 0 20px; }

View File

@@ -612,3 +612,35 @@ function schemaMouseup(ev, db) {
cookie('adminer_schema-' + db + '=' + s, 30); //! special chars in db
}
}
var helpOpen;
function helpMouseover(el, text, right) {
if (window.jush) {
helpOpen = 1;
var help = document.getElementById('help');
help.innerHTML = text;
jush.highlight_tag([ help ]);
alterClass(help, 'hidden');
var top = 0, left = 0, parent = el;
do {
top += parent.offsetTop;
left += parent.offsetLeft;
} while (parent = parent.offsetParent);
help.style.top = (top - (right ? (help.offsetHeight - el.offsetHeight) / 2 : help.offsetHeight)) + 'px';
help.style.left = (left + (right ? el.offsetWidth : (el.offsetWidth - help.offsetWidth) / 2)) + 'px';
}
}
function helpMouseout() {
helpOpen = 0;
setTimeout(function () {
if (!helpOpen) {
helpClose();
}
}, 200);
}
function helpClose() {
alterClass(document.getElementById('help'), 'hidden', true);
}