Close the editor menu as soon as a choice is made
This commit is contained in:
parent
2e8d7f9f1d
commit
3c2e3ecb8f
1 changed files with 10 additions and 0 deletions
|
@ -10,6 +10,14 @@ function openMenu(anchor, menu) {
|
|||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Close a menu.
|
||||
*/
|
||||
function closeMenu(menu) {
|
||||
clearTimeout(menu.timer);
|
||||
menu.style.display = "none";
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback called when the mouse enters a menu anchor.
|
||||
*/
|
||||
|
@ -58,7 +66,9 @@ function createMenu(anchorid, menuid, delay) {
|
|||
var anchor = $(anchorid);
|
||||
var menu = $(menuid);
|
||||
|
||||
anchor.observe("mouseup", function (event) { closeMenu(menu) });
|
||||
anchor.observe("mouseover", function (event) { enterMenuAnchor(anchor, anchor, menu, delay) });
|
||||
anchor.observe("mouseout", function (event) { leaveMenuAnchor(event, anchor, menu) });
|
||||
menu.observe("mouseup", function (event) { closeMenu(menu) });
|
||||
menu.observe("mouseout", function (event) { leaveMenu(event, anchor, menu) });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue