Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This patch attached fixes the biggest usability issue with this module.
Now you can click the bullets to make the menu tree's expand rather than clicking the link itself. This makes the link still a link and everyone is happy!
How this is done:
a
is positioned absolute over top of the bullet with the parent
's being position: relative.
Please test this on these OTHER than Garland. I have tested in IE 6, Firefox (both mac and pc), and Opera (both mac and pc).
Comment | File | Size | Author |
---|---|---|---|
#33 | dhtml_menu.js_.patch | 1.77 KB | professorbikeybike |
#7 | dhtml_menu_bullet_click_1.patch | 2.4 KB | Anonymous (not verified) |
#1 | dhtml_menu_bullet_click_0.patch | 2.23 KB | Anonymous (not verified) |
dhtml_menu_bullet_click.patch | 1.73 KB | Anonymous (not verified) | |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedanother one. forgot to remove 1 commented out line and added a few ; for coding standards.
Comment #2
Morbus IffFrom IRC:
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedand my last 2 cents on this..
on normal tree views, you click the tree's + / - or bullet to expand. ALL OS's do this.. what is wrong with it in this case? This is a tree view!
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedIMO it should be optional.
It can be configged.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedjust tested on some custom themes..
positioning of the hidden div needs some work. gotta look into offsets.
Comment #6
filiptc CreditAttribution: filiptc commented+1
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedalright.
bit of a new approach. instead of sizing the hidden div 14px x 14px.. we build it dynamically based on the parent's width and 's height.
tested in firefox (pc / mac), safari, IE 6 .
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedwhoops i put
<a>
there.Comment #9
armada1 CreditAttribution: armada1 commentedHello,
This patch does not work for me.
Perhaps because I do not use CVS and patched i it manuallyll
It would be very nice if you might post the whole codeof the patched dhtmll.js and the menuu module
Thank you!
Comment #10
scor CreditAttribution: scor commentedI know double click may conflict with another module, but how about using the simple click and the double :
simple click : open the link
double click : open the folder
another idea : enlarging the clickable zone of the bullet, say 3 or 4 px around it, giving this way a 10px zone. the cursor could change, and/or the bullet could become a different color, or turning 45° down, showing there is an special action there. The link itself would have different css rules when hovered (underline, color). This way, everybody is happy because it would be obvious that there are 2 different actions possible there...expanding or opening the link.
Comment #11
FreeFox CreditAttribution: FreeFox commentedHi Steve, just tried you patch on the "dhtml_menu-5.x-0.7" but it won't work. I checked the patch code but the code differences are too big for me to handle (yet). Could you please release a patch that will work on the "dhtml_menu-5.x-0.7" code?
Thanks in advance
Jan
Comment #12
AdrianB CreditAttribution: AdrianB commentedI agree with merlinofchaos, it should be optional. Even though I think it is more logical to expand using a bullet (or some +/-) I think some users (like myself) hade adopted their sites to the current behaviour.
Comment #13
nwf CreditAttribution: nwf commentedThis patch does work! The trick is to clear your browser cache after patching. That did it for me. It's actually a simple patch to apply manually, if necessary.
Thanks!
Comment #14
StenBH CreditAttribution: StenBH commentedGreat work! I support making it work this way.
Comment #15
StenBH CreditAttribution: StenBH commentedCan not mak this patch work, maybe because it is suposed to modify 0.x-dev and the only version available for download is version 0.7 (introducing doubleclick).
Would it be possible to make the 0.x-dev available again for download or to make a new patch of 0.7? I would really like to have something like this on my site!!!
Comment #16
SNU CreditAttribution: SNU commentedI tested patch1 patching 0.7.
Patching worksm but the patch isnt complete yet. I reloaded my page several times and noticed that ony sometimes the menu opens/closes clicking the bullet. Mostly klicking the bullet just marks the link. Also mostly I cannot close the menu. It stays opened and as I said the link gets marked klicking he bullet.
Comment #17
cburschkahttp://drupal.org/node/113599 has been marked as a duplicate of this issue.
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedWhy I haven't committed this feature is because it does not work on every theme because of variations of styles on menu items.
I plan to finally commit it soon but provide a proper warning message on the settings page where you would enable this functionality just simply describing that styles can affect the placement of this feature.
I would appreciate more testing too.
Comment #19
cburschkaI just noticed that the settings page currently contains a commented-out setting for this:
When was this added, and is it in this patch? Just a bit confused because I thought all relevant commits and changes would go through this issue.
Comment #20
jiangxijay CreditAttribution: jiangxijay commentedSubscribe.
Comment #21
jiangxijay CreditAttribution: jiangxijay commentedBTW, an option to apply the drop-down function to only the bullets makes this module usable in a new installation that is being prototyped in the next 3 weeks.
Any resolution would be greatly appreciated! Thanks so much in advance for this great module.
Comment #22
cburschkaCould we have an optional setting, please? I agree with Merlinofchaos, Morbus Iff and AdrianW on this - and the patch from #7 does not make this configurable.
However, the patch works (with fuzz) on current HEAD. It does not work in DRUPAL-5. I have adjusted the version of this issue to reflect this.
Comment #23
jiangxijay CreditAttribution: jiangxijay commentedJust to make sure: has the developer determined that this definitely won't appear as a version 5 option? Even with a caveat that some styles won't support it?
This will be a make-or-break decision for a large site that requires a number of modules that aren't available for Drupal 6 next.
Comment #24
jiangxijay CreditAttribution: jiangxijay commentedWell, I'm flummoxed. I unclicked admin/settings/dhtml_menu "JQuery slide effect" and clicked it again. (I think I made no other changes) ... and I'm seeing small plus icons next to DHTML menus that can be expanded ... and the text link only opens the page.
In other words, something changed and this is working for me ...
Comment #25
jiangxijay CreditAttribution: jiangxijay commentedNope. The correct action is showing with the book navigation block, not with DHTML_menu.
Comment #26
jiangxijay CreditAttribution: jiangxijay commentedThe Javascript tools/activemenu module is providing the correct actions as requested at the start of this thread.
The ReadMe file provides instructions for calling activemenu_js from any module.
Comment #27
nexxer CreditAttribution: nexxer commentedSubscribe
Comment #28
SeanBannister CreditAttribution: SeanBannister commentedVery useful, would really like this as an option on the settings page.
Comment #29
Jody LynnYes, jstools modules's active_menu did this exact job and uses nice + and - icons too. Might mark this thread as fixed - it could also be cool to refer to that module as an alternative on your project page for people looking for the alternative functionality.
Comment #30
Romasito CreditAttribution: Romasito commentedLynn, not exactly. jstools active_menu expands only first level submenus... and it does a request each time, i find it rather too much overhead for such thing as navigation (I mean an ajax call each time). It's IMHO better when whole menu is fetched from db and then collapsed with javascript. Clickable bullets is a usability thing. I did not like the way link is lost because of the link:)
Comment #31
SeanBannister CreditAttribution: SeanBannister commentedI agree.
Comment #32
Anonymous (not verified) CreditAttribution: Anonymous commentedsomeone take over this patch please.
it's fairly easy.
the problem is that the patch does not apply properly but its an easy patch.
If you look at one of the later ones i submitted, you should be able to take the JS code from it and dump it in the .js file. That's pretty much the entire patch.
I'm giving up on this as I do not even use dhtml_menu anymore but switched to using simplemenu. It's easier to add in simplemenu as an admin menu which was the only reason why I used dhtml_menu since simplemenu is position: absolute; and OUTSIDE of the main dom so its easy to add into a theme without having to adjust the theme for it.
Comment #33
professorbikeybike CreditAttribution: professorbikeybike commentedThis is very nice functionality. Personally, I am going to theme the bullets into plus/minus signs to make it obvious for the user.
Anyway, here is an attempt at converting this patch to 6.x-2.0
It seems to work for me...
Comment #34
cburschkaI'm going to try my hand at this.
I believe that it is possible to keep the logic entirely in JS, only passing on a configuration option like the Slide Effect and Sibling Closer.
My idea is to change the list styles to plus/minus signs in Javascript if the option is enabled, and to listen for clicks on the li element rather than the a element. Inner elements override outer ones, so the Javascript should no longer block the link.
Comment #35
cburschkaImpossible due to the cascading event - nested li items will contain all the listeners of the parent items. I can't work around this. Postponed.
Comment #36
link0ff CreditAttribution: link0ff commentedI'm following up from #280280: Expand without a link since this issue is more correct to discuss implementation of tree-view menus where clicking on plus/minus signs expands/collapses the submenu.
Since list style icons apparently cannot be made clickable, another way to implement is to prepend a new element with plus/minus signs to every expandable li. Such an element could listen to clicks to expand/collapse the submenu and have plus/minus signs as its background image. This also means disabling list-style-type and list-style-image on li elements.
Comment #37
cburschkaThis could provide a more elegant solution:
http://www.quirksmode.org/js/events_order.html
(No time to do that now, just saving the link for later.)
Clarification: The problem, as stated, is that you can only make list icons clickable by making the whole li clickable. Since the li elements are nested, clicking on one will trigger several events and wreak havoc. The above link shows how to stop propagation in overlapping click events.
Comment #38
cburschkaThis will get into 7.x first.
Comment #39
jacobjanzen CreditAttribution: jacobjanzen commentedSubscribe
Comment #40
cburschkaIt won't be in D6.
Comment #41
daniorama CreditAttribution: daniorama commentedWhy not? I mean, who is using D7? I don't understand developing features that people really need (asking for nearly 2 years) in a version of drupal that is supposed to be the current one in 1-2 years.
It's really frustrating having to possible solutions for menus (DHTML and Activemenus) and that each of them does right what the other doesn't, but neither is "complete"... Wouldn't be better try to work together? I know they are really different but maybe both could use solutions for the other one. Just one idea...
Anyway, maybe one day. Thanks for the hard work :)
Comment #42
daniorama CreditAttribution: daniorama commentedI've been trying many things and I'm sorry to say that I entirely recommend to downgrade to the 6.x-2.2 and apply the patch in #33 if anyone wants this feature (and also to enable dhtml in some menus and fix some issues with Tabs in Zen theme).
If you apply the patch remember to disable and then enable once more the jQuery effect (it must be enabled to work) and clear the cache of your browser. The only problem I had with the patch was with bullets not showing in Opera with Zen theme. Any Idea? Thank you very much.
Comment #43
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.