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

Display help for functions and MySQL engines

This commit is contained in:
Jakub Vrana
2013-07-19 11:55:49 -07:00
parent f8453fe65c
commit 3b3d169c72
8 changed files with 33 additions and 20 deletions

View File

@@ -615,8 +615,15 @@ function schemaMouseup(ev, db) {
var helpOpen;
function helpMouseover(el, text, right) {
if (window.jush) {
/** Display help
* @param HTMLElement
* @param string
* @param bool display on left side (otherwise on top)
*/
function helpMouseover(el, text, side) {
if (!text) {
helpClose();
} else if (window.jush) {
helpOpen = 1;
var help = document.getElementById('help');
help.innerHTML = text;
@@ -627,11 +634,13 @@ function helpMouseover(el, text, right) {
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';
help.style.top = (top - (side ? (help.offsetHeight - el.offsetHeight) / 2 : help.offsetHeight)) + 'px';
help.style.left = (left - (side ? help.offsetWidth : (help.offsetWidth - el.offsetWidth) / 2)) + 'px';
}
}
/** Close help after timeout
*/
function helpMouseout() {
helpOpen = 0;
setTimeout(function () {
@@ -641,6 +650,8 @@ function helpMouseout() {
}, 200);
}
/** Close help
*/
function helpClose() {
alterClass(document.getElementById('help'), 'hidden', true);
}

View File

@@ -351,7 +351,7 @@ function isCtrl(event) {
/** Return event target
* @param Event
* @return HtmlElement
* @return HTMLElement
*/
function getTarget(event) {
return event.target || event.srcElement;
@@ -429,6 +429,7 @@ function functionChange(select) {
} else if (input.origMaxLength >= 0) {
input.maxLength = input.origMaxLength;
}
helpClose();
}