PDA

View Full Version : Simple Tree Menu is not ready for prime time. Needs to be removed...



outre2001
09-28-2006, 04:42 AM
1) Simple Tree Menu

2) http://www.dynamicdrive.com/dynamicindex1/navigate1.htm

3) Hello folks. This one is a doozy and needs to be taken down until it's really ready in order to save others the time I spent figuring it out. Here's the list.
a. The rel="open/closed" attribute is ignored by the script and the menu always opens expanded
b. The code style is sub-par: missing semi-colons and braces to clearly identify blocks. When running javascript optimizers (ESC) it breaks like there's no tomorrow.
c. the logic seems to be a bit odd. why not provide separate functions to expand/collaps branches of the tree after the initial creation?

Don't mean to be ungrateful. You guys are doing great work, but this one is not cooked just yet.
Best,
-Kiril

ddadmin
09-28-2006, 07:21 AM
Well, b) and c) are not bugs, but regarding a), do you have an online example of the problem? I see your related thread here (http://www.dynamicdrive.com/forums/showthread.php?t=12680), though it doesn't offer enough info for me to go by.

One thing to remember is that the persistence feature if it's enabled will overrule the "rel" settings, so if the last state of the menu is open yet the "rel" attribute tells it to be closed, the former wins out.

Twey
09-28-2006, 06:57 PM
If b) and c) were considered bugs, half the scripts on DD would have to be taken down :p Few use an aesthetic coding style (although missing braces aren't usually an example of this), and the logic is often not only odd but flawed, using browser detection or other such nasty ideas. I agree that something needs to be done about it, but I believe ddadmin to be quite busy. Perhaps you could refactor the script yourself?

panachepad
09-29-2006, 07:48 AM
I'm having trouble with this now, also, but I don't think it's quite the same trouble? There are two ways to go with this, and I am using the cookied version. Everything was fine (I think / I didn't notice) until I moved the menu to a server side include.

Now it seems that when the user clicks on a folder to open it, the open image appears, but when they click on that open image to close it, the menu snaps shut but the image for the closed folder does not appear. The user must refresh the page to get the closed folder image to reappear.

Right-clicking on the spot where the closed folder image should be in this case reveals that the code is looking for the folder image in the folder of the page, instead of looking for the folder image in the root. I do have uploaded the folder images in both places, and refreshing solves it, but it is mighty cumbersome, i.e., useless.

I don't know javascript code at all so I have no idea what to change to make this work.

Please help me.