1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-24 15:12:51 +02:00

Reveal menu items only if mouse is over wide links

This commit is contained in:
Jakub Vrana
2012-08-20 22:20:22 -07:00
parent beafccb8c3
commit 5d337fe04c
4 changed files with 19 additions and 7 deletions

View File

@@ -209,10 +209,22 @@ function pageClick(href, page, event) {
}
}
function menuOver(el) {
el.style.overflow = 'visible';
/** 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';
}
}
/** Hide items in menu
* @param HTMLElement
*/
function menuOut(el) {
el.style.overflow = 'auto';
}