This is a great tool, especially for dealing with the admin navigation, however I had need of using it for a navigation block that would function as the primary navigational element for a Client site, and I wanted it to "be prettier". Thus I added in the show() hide() functions from jQuery into the code, and I wanted to give the admin some control over the speed of that effect. To reach that end I added an admin page for the dhtml_menu that allows the administrator to determine the speed at which the navigational system would expand.
Default expansion will look no different from the current module, however it can be changed from instant to "slow" or "fast".
Additionally I altered the javascript addition of "block" as the display type to "inline" as this SHOULD fix the double margin bug in IE and won't effect the output of standards compliant browsers.
This is my first attempt at a real tested patch and everything appears to be in order, however I'd prefer it if someone were to look over the code.
I modified both the .module and the .js I was unsure how to upload both, so the module is in this post and the js will be in the next.
Eclipse
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | dhtml_menu_1.patch | 3.39 KB | eclipsegc |
| #3 | dhtml_menu_0.patch | 3.26 KB | eclipsegc |
| #1 | dhtml_menu_js.patch | 976 bytes | eclipsegc |
| dhtml_menu_module.patch | 1.67 KB | eclipsegc |
Comments
Comment #1
eclipsegc commentedThe js patch as promised.
Comment #2
eclipsegc commentedSeems I missed the access on the admin menu item for this. I'll fix it tomorrow and put up a new patch.
Comment #3
eclipsegc commentedOK, so thanks to James Walker I've got the .js and .module file all contained in 1 .patch file now. Thank you James.
I updated the access to the menu. This should work as expected now.
I'd love some feed back, so let me know what you think.
Eclipse
Comment #4
eclipsegc commentedOk, after deploying this a couple places another bug was brought to my attention. It's squashed and menus should not stay closed when you tell them to. (heh) so yeah that was a pain.
Eclipse
Comment #5
eclipsegc commentedBTW HUGE!!!! thanks goes out to iratik from #jquery. I'd still be VERY screwed on this patch if not for his interest and help.
Comment #6
eclipsegc commentedMy previous post about the bug is a bit ambiguous, not to mention stated wrong, so I'll reiterate here.
My previous patches suffered from a bug which would leave the most recently closed submenu open on the next page load. At first I thought this was some function of the admin menu, as it was invariably the last thing I closed, but then after some more experimentation and a couple other people playing with it on their own, it was obvious that any submenu did it, I just happened to always close admin last. Anyway, it was a real pain in the tail to kill. I'm still unsure why show()/hide() had that effect, something to do with states being saved before the css was set, but never-the-less this patch takes care of that now.
Eclipse
Comment #7
andrewfn commentedHere are a few questions about this patch.
dhtml_menu_menu()is missing the$may_cacheargument, which the module documentation warns against doing.Comment #8
andrewfn commentedI decided to do some comparative testing of the two methods of getting JavaScript slide effects: the method in head which uses slideUp/Down, and the method in this patch which uses hide/show. The effect of hide/show looks nicer (to me) and is a little more robust.
Testing was done using the Zen theme. I was able to break IE6 and IE7 with hide/show by opening several lower menus, and then opening and closing one near the top. Artifacts from opened menus corrupted the screen.
Comment #9
brmassa commentedGuys,
its mainly fixed with the new jQuery within D6.
regards,
massa
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.