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).

  • CommentFileSizeAuthor
    #33 dhtml_menu.js_.patch1.77 KBprofessorbikeybike
    #7 dhtml_menu_bullet_click_1.patch2.4 KBAnonymous (not verified)
    #1 dhtml_menu_bullet_click_0.patch2.23 KBAnonymous (not verified)
    dhtml_menu_bullet_click.patch1.73 KBAnonymous (not verified)
    Support from Acquia helps fund testing for Drupal Acquia logo

    Comments

    Anonymous’s picture

    another one. forgot to remove 1 commented out line and added a few ; for coding standards.

    Morbus Iff’s picture

    From IRC:

    [20:35]  <Morbus> bullets are /really/ hard to click on.
    [20:35]  <Morbus> i'm not going to spend time clicking 3 pixels worth of space.
    [20:35]  <Morbus> and neither is anyone else.
    [20:35]  <craq> its 14px 
    [20:35]  <craq> :P
    [20:35]  <Morbus> regardless, it's not intuitive, imo.
    [20:36]  <Morbus> it goes against, say, drupal fieldsets.
    [20:36]  <craq> how is it not? it takes away the link from the actual link 
    [20:36]  <Morbus> which can have both the bullet and the link clickable.
    [20:36]  <craq> now the link can stay a link
    [20:36]  <Morbus> yes - and i agree that that's a problem (it is with bot, actually)
    [20:36]  <Morbus> but makign it different from fieldset, or unintuitive (people click links, not bullets) is not the solution.
    [20:37]  <craq> its like os x finder.. you click the bullets to expand the folders ?
    [20:37]  <Morbus> i don't care about os ox.
    [20:37]  <Morbus> i care about mixing UI practices in a single application.
    [20:38]  <Morbus> and i never use that view in the Finder, for what it's worse.
    [20:38]  <Morbus> i always use the panel view.
    [20:38]  <Morbus> Columns view.
    [20:38]  <Morbus> *for what it's worth
    [20:38]  <-- izaak has quit (Read error: 113 (No route to host))
    [20:38]  --> davidstrauss (n=straussd@cpe-72-177-13-129.austin.res.rr.com) has joined #drupal
    [20:38]  <craq> i c 
    
    Anonymous’s picture

    and 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!

    merlinofchaos’s picture

    IMO it should be optional.

    It can be configged.

    Anonymous’s picture

    Status: Needs review » Needs work

    just tested on some custom themes..

    positioning of the hidden div needs some work. gotta look into offsets.

    filiptc’s picture

    +1

    Anonymous’s picture

    alright.

    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 .

    Anonymous’s picture

    Status: Needs work » Needs review

    whoops i put <a> there.

    armada1’s picture

    Hello,

    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!

    scor’s picture

    I 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.

    FreeFox’s picture

    Hi 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

    AdrianB’s picture

    I 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.

    nwf’s picture

    This 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!

    StenBH’s picture

    Great work! I support making it work this way.

    StenBH’s picture

    Can 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!!!

    SNU’s picture

    Category: task » bug
    Priority: Critical » Normal

    I 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.

    cburschka’s picture

    http://drupal.org/node/113599 has been marked as a duplicate of this issue.

    Anonymous’s picture

    Why 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.

    cburschka’s picture

    Category: bug » feature

    I just noticed that the settings page currently contains a commented-out setting for this:

    //   $form['dhtml_menu_bullet'] = array(
    //     '#type'          => 'checkbox',
    //     '#title'         => t('Item bullets'),
    //     '#description'   => t('The menu only collapses/exapand when clicking over the item bullet. WARNING: some themes do not show bullets!'),
    //     '#default_value' => variable_get('dhtml_menu_bullet', 0)
    //   );
    

    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.

    jiangxijay’s picture

    Subscribe.

    jiangxijay’s picture

    BTW, 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.

    cburschka’s picture

    Version: 5.x-0.x-dev » 6.x-1.x-dev
    Status: Needs review » Needs work

    Could 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.

    jiangxijay’s picture

    Just 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.

    jiangxijay’s picture

    Well, 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 ...

    jiangxijay’s picture

    Nope. The correct action is showing with the book navigation block, not with DHTML_menu.

    jiangxijay’s picture

    The 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.

    nexxer’s picture

    Subscribe

    SeanBannister’s picture

    Very useful, would really like this as an option on the settings page.

    Jody Lynn’s picture

    Yes, 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.

    Romasito’s picture

    Lynn, 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:)

    SeanBannister’s picture

    I agree.

    Anonymous’s picture

    someone 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.

    professorbikeybike’s picture

    FileSize
    1.77 KB

    This 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...

    cburschka’s picture

    Version: 6.x-1.x-dev » 6.x-2.0
    Assigned: » cburschka

    I'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.

    cburschka’s picture

    Assigned: cburschka » Unassigned
    Status: Needs work » Postponed

    to listen for clicks on the li element rather than the a element.

    Impossible due to the cascading event - nested li items will contain all the listeners of the parent items. I can't work around this. Postponed.

    link0ff’s picture

    I'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.

    cburschka’s picture

    Version: 6.x-2.0 » 6.x-3.x-dev

    This 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.

    	if (e.stopPropagation) e.stopPropagation(); // Compliant browsers.
    	e.cancelBubble = true; // Internet Explorer hack
    
    cburschka’s picture

    Version: 6.x-3.x-dev » 7.x-1.x-dev
    Assigned: Unassigned » cburschka

    This will get into 7.x first.

    jacobjanzen’s picture

    Version: 7.x-1.x-dev » 6.x-3.0-alpha

    Subscribe

    cburschka’s picture

    Version: 6.x-3.0-alpha » 7.x-1.x-dev

    It won't be in D6.

    daniorama’s picture

    Why 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 :)

    daniorama’s picture

    Version: 7.x-1.x-dev » 6.x-2.2
    Assigned: cburschka » Unassigned
    Status: Postponed » Fixed

    I'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.

    Anonymous’s picture

    Status: Fixed » Closed (fixed)

    Automatically closed -- issue fixed for two weeks with no activity.