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
| @@ -97,7 +97,7 @@ | @@ -97,7 +97,7 @@ | ||
| 97 | </div><!-- id='navigation_bar' --> | 97 | </div><!-- id='navigation_bar' --> |
| 98 | 98 | ||
| 99 | <script type="text/javascript"> | 99 | <script type="text/javascript"> |
| 100 | - prepareMenu('navigation_bar'); | 100 | + prepareMenu('navigation_bar', { timeout: 50 }); |
| 101 | </script> | 101 | </script> |
| 102 | 102 | ||
| 103 | <div id='search_box'> | 103 | <div id='search_box'> |
public/javascripts/menu.js
| 1 | -function prepareMenu(id) { | 1 | +function prepareMenu(id, options) { |
| 2 | + | ||
| 3 | + var menuCloseTimeout = options.timeout; | ||
| 2 | 4 | ||
| 3 | if ( document.all ) { | 5 | if ( document.all ) { |
| 4 | // add a class for work arround msie´s css bugs | 6 | // add a class for work arround msie´s css bugs |
| @@ -48,11 +50,11 @@ function prepareMenu(id) { | @@ -48,11 +50,11 @@ function prepareMenu(id) { | ||
| 48 | 50 | ||
| 49 | link.onmouseover = link.onfocus = | 51 | link.onmouseover = link.onfocus = |
| 50 | function () { | 52 | function () { |
| 51 | - this.openSubMenu(false); | 53 | + this.openSubMenu(false); |
| 52 | }; | 54 | }; |
| 53 | link.onmouseout = link.onblur = | 55 | link.onmouseout = link.onblur = |
| 54 | function () { | 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 | ul.closeSubMenu = function(){ this.style.display = "none" } | 60 | ul.closeSubMenu = function(){ this.style.display = "none" } |
| @@ -72,7 +74,8 @@ function prepareMenu(id) { | @@ -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 | if ( document.all ) { | 79 | if ( document.all ) { |
| 77 | function forceUlFocusFromLink ( a ) { | 80 | function forceUlFocusFromLink ( a ) { |
| 78 | var stop = false; | 81 | var stop = false; |
| @@ -104,7 +107,6 @@ function prepareMenu(id) { | @@ -104,7 +107,6 @@ function prepareMenu(id) { | ||
| 104 | a.onblur = function() { forceUlBlurFromLink(this) }; | 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 ///////////////////// |