Commit b3053c4b0f2969846df1f8b1320e969f6418fe3c

Authored by AurelioAHeckert
1 parent b2b97476

ActionItem152: baixando a dependencia de prototype para o IEca

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1350 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 1 changed file with 11 additions and 4 deletions   Show diff stats
public/javascripts/menu.js
@@ -6,6 +6,7 @@ function prepareMenu(id, options) { @@ -6,6 +6,7 @@ function prepareMenu(id, options) {
6 // add a class for work arround msie's css bugs 6 // add a class for work arround msie's css bugs
7 $(id).className += " msie"; 7 $(id).className += " msie";
8 } 8 }
  9 + $(id).className += " menuRoot";
9 10
10 var zIndex = 10; 11 var zIndex = 10;
11 12
@@ -87,18 +88,24 @@ function prepareMenu(id, options) { @@ -87,18 +88,24 @@ function prepareMenu(id, options) {
87 // MS IE sucks, BTW. 88 // MS IE sucks, BTW.
88 if ( document.all ) { 89 if ( document.all ) {
89 function forceUlFocusFromLink ( a ) { 90 function forceUlFocusFromLink ( a ) {
90 - var stop = false; 91 + /*var stop = false;
91 a.ancestors().each( function(el) { 92 a.ancestors().each( function(el) {
92 if ( el.id == "menu" ) { stop = true } 93 if ( el.id == "menu" ) { stop = true }
93 if ( ! stop && el.onfocus ) { el.onfocus() } 94 if ( ! stop && el.onfocus ) { el.onfocus() }
94 - } ); 95 + } );*/
  96 + var el = a.parentNode;
  97 + while ( / menuRoot/.test(el.className) ) el = el.parentNode;
  98 + if ( el.onfocus ) { el.onfocus() }
95 } 99 }
96 function forceUlBlurFromLink ( a ) { 100 function forceUlBlurFromLink ( a ) {
97 - var stop = false; 101 + /*var stop = false;
98 a.ancestors().each( function(el) { 102 a.ancestors().each( function(el) {
99 if ( el.id == "menu" ) { stop = true } 103 if ( el.id == "menu" ) { stop = true }
100 if ( ! stop && el.onblur ) { el.onblur() } 104 if ( ! stop && el.onblur ) { el.onblur() }
101 - } ); 105 + } );*/
  106 + var el = a.parentNode;
  107 + while ( / menuRoot/.test(el.className) ) el = el.parentNode;
  108 + if ( el.onblur ) { el.onblur() }
102 } 109 }
103 $$("#" + id + " ul ul a").each( function( a ) { 110 $$("#" + id + " ul ul a").each( function( a ) {
104 // os links do sub menu forçarão o foco do ul 111 // os links do sub menu forçarão o foco do ul