> myTree.addEvent('focus', function(){ if(myTree.blur) myTree.blur(); });
>
> Why are you doing this?

i do this to prevent the ugly outlines when you click on an anchor.



> if( $chk( myTree.getNext('ul') ) ){
>
> you dont need $chk here, a simple if(myTree.getNext('ul')) is fine.

i thought $chk would be more bullet-proof and i now removed it -
thanks for the hint.



> myTree.set('href','javascript: void(0);');
>
> you dont need this. Use e.preventDefault() into the click event that you
> define some lines after it and it will be fine.

NICE! overlooked this until now. I did this to have the original href
stored and to use it later on the clicks (which atm are doing nothing)



> *This is one of those things that should really use event delegation.
>
> http://mootools.net/docs/more/Element/Element.Delegation
>
> Using event delegation is more memory efficient and scales well in this
> case. Still it is perfect if you are loading new folders and files, cause
> you wont need to add the click event on them.

hmm, i am stuck ...

<li>
  <a href="...">Node</a>
  <ul>
    <li>...</li>

atm the click/enter and leave events are bound to the 1st <a> and do
work perfect.

If i add the click to the <li> delegating it to a (click:relay(a)) it
will delegate the click to the whole content of the clicked <li>.

I tried a:first-child but same effect, the click seems still to be
captured for the whole <li>.

Do you have any example of what you think it should be done?

Reply via email to