[Vtigercrm-developers] Submenu delay

Stephen Mack stephen at efronteras.com
Sun Mar 1 14:53:53 PST 2009


Greetings fellow coders...

While using vtiger, I've found the second and third row of menus to be a
wonderful idea but difficult to use because when you mouseover the main
menu, it drops down to cover the other menu options.  So I've been playing
with the vtiger menu subsystem to correct this annoyance.

I figured I would post the "patch" here first and get some feedback from the
development community before I post it to the forums.  The patch affects the
*include/js/general.js* file only and requires the addition of two global
variables and contitional use of the *setTimeout* function.  The logic
behind the change keeps the main menu from being desplayed on mouseover
unless the user pauses on a menu item for more than half a second.  When
that happens the menus funciton normally until the page is refreshed.

Add the global variables around line 13

var gMenu=0;
var gMenuDelay;

In function *fnDropDown* change the last line *tagName.style.display =
'block';* (near line 2070) in the function to look like the following:

    if(gMenu)
      tagName.style.display = 'block';
    else
      gMenuDelay=setTimeout(function(){tagName.style.display =
'block';gMenu=1;},500);

In function *fnHideDrop* add the following code to the end of the function:

    clearTimeout(gMenuDelay);

That's it.  Try it out and post your feedback.

-- Stephen Mack
Gerente de Ventas y Marketing
Escuela Fronteras
www.eFronteras.com
skype: eFronteras.Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20090301/00ebdc55/attachment-0003.html 


More information about the vtigercrm-developers mailing list