Commit 2f0df53b62d2d518142870f78a26b53ae739839d
1 parent
4f2e4839
Exists in
master
and in
22 other branches
ActionItem70: setting a smaller timeout for closing the popup menu in the top bar
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@509 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
9 additions
and
7 deletions
Show diff stats
app/views/layouts/application.rhtml
public/javascripts/menu.js
| 1 | -function prepareMenu(id) { | |
| 1 | +function prepareMenu(id, options) { | |
| 2 | + | |
| 3 | + var menuCloseTimeout = options.timeout; | |
| 2 | 4 | |
| 3 | 5 | if ( document.all ) { |
| 4 | 6 | // add a class for work arround msie´s css bugs |
| ... | ... | @@ -48,11 +50,11 @@ function prepareMenu(id) { |
| 48 | 50 | |
| 49 | 51 | link.onmouseover = link.onfocus = |
| 50 | 52 | function () { |
| 51 | - this.openSubMenu(false); | |
| 53 | + this.openSubMenu(false); | |
| 52 | 54 | }; |
| 53 | 55 | link.onmouseout = link.onblur = |
| 54 | 56 | function () { |
| 55 | - this.timeOutClose = setTimeout( this.closeSubMenu.bind(this), 333 ); | |
| 57 | + this.timeOutClose = setTimeout( this.closeSubMenu.bind(this), menuCloseTimeout ); | |
| 56 | 58 | }; |
| 57 | 59 | |
| 58 | 60 | ul.closeSubMenu = function(){ this.style.display = "none" } |
| ... | ... | @@ -72,7 +74,8 @@ function prepareMenu(id) { |
| 72 | 74 | }); |
| 73 | 75 | |
| 74 | 76 | |
| 75 | - ////// INI - Work Arround Bug da disgraça do M$IE ///////////////////// | |
| 77 | + // **** begin of workaround for Microsoft Internet Explorer **** | |
| 78 | + // MS IE sucks, BTW. | |
| 76 | 79 | if ( document.all ) { |
| 77 | 80 | function forceUlFocusFromLink ( a ) { |
| 78 | 81 | var stop = false; |
| ... | ... | @@ -104,7 +107,6 @@ function prepareMenu(id) { |
| 104 | 107 | a.onblur = function() { forceUlBlurFromLink(this) }; |
| 105 | 108 | } |
| 106 | 109 | }); |
| 107 | - } | |
| 110 | + } // ** end of workaround for Microsoft Internet Explorer. | |
| 108 | 111 | |
| 109 | 112 | } |
| 110 | -////// END - Work Arround Bug da disgraça do M$IE ///////////////////// | ... | ... |