Hi there, I've added the D6 functionality of closing the siblings of a menu upon opening it.

I've not yet set is as an option in the DHTML menu settings page, but I'm working on that so I can finally roll out my first contribution \o/

here's the temporary version of the js to have direct siblings close upon opening a menu, which in other words simple makes sure that only 1 menu is open at a time

it will not close child menus and it will not close siblings at the same level in different menus

working on a proper patch, but considering our active project does not need this functionality anymore, it might be a while until I can find the time to finish this properly
I would however appreciate testing and feedback on this functionality

CommentFileSizeAuthor
#9 link.txt54 byteseltoneerkens
dhtml_menu.js_.txt3.9 KBseutje

Comments

phpsharma’s picture

This Worked fine for me in 5.1.7

seutje’s picture

yeh, but I wanna work on implementing them as options and to add an option to select all the siblings (not just the ones in the same menu)

premanup’s picture

I've figured out no more jQuery slide effect for opening menu.

seutje’s picture

I'm sry... what?

are u trying to say this modification makes the menu's not slide anymore?

premanup’s picture

yes, I mean this modification makes the menu's not slide any more when it's opening. Closing menu works properly as original script provide.

seutje’s picture

that's odd, I didn't even change anything about this line

$(submenu).animate({height: 'show', opacity: 'show'}, '500');

just added handling for the siblings

does the original script make menu's slide open properly? although I don't rly see how anything could interfere

quinti’s picture

ohs, thank u very much
That's exactly what I was trying to do,
very good,
thanks

seutje’s picture

Assigned: seutje » Unassigned

hmm, lost track of this and now it seems a lil silly to backport

my apologies

eltoneerkens’s picture

Category: feature » support
Priority: Minor » Critical
StatusFileSize
new54 bytes

Ah.... I'm trying to use the dhtml_menu.js which makes sure that only 1 menu is open at a time. It's not working in my situation.
Could you please have a look 'Seutje' at this link. (see attachment) Hopefully you can help me with this. Thanks in advance!

seutje’s picture

Priority: Critical » Normal

the link you provided uses http://78.157.195.41/~rubenbelli/rubenbellinkx_drupal/modules/dhtml_menu... which doesn't close direct siblings like the one at the top of this issue

eltoneerkens’s picture

Thanks for your reply.
Hmm sorry, I replaced it over and over and lost track I think.
What I just did....
I copied the code from above but still it doesn't close the direct siblings. Is it the structure of my menu? Hope to hear from you.

seutje’s picture

hmm, looks like every tree is a separate menu, and wrapped in it's own ul:

<ul class="menu dhtml_menu menu-root">
  <li id="menu-sub106" class="menutitle expanded"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/" style="display: block; z-index: 2;">film/video</a>
    <div style="display: block;" id="sub106" class="submenu sub-expanded">
      <ul class="menu dhtml_menu">
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">stream</a></li>
        <li class="leaf"><a href="/~rubenbelli/rubenbellinkx_drupal/?q=node/8">mattrass, taps, fire</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">the table turning</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">the musical chair</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">troissoeur</a></li>
      </ul>
    </div>
  </li>
</ul>

<ul class="menu dhtml_menu menu-root">
  <li id="menu-sub91" class="menutitle expanded"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/" style="display: block; z-index: 2;">installations</a>
    <div id="sub91" class="submenu sub-expanded" style="display: block;">
      <ul class="menu dhtml_menu">
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">houseplant</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">elephant's ear</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">light - sensitive material</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">the five sinks</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">rat experiment</a></li>
      </ul>
    </div>
  </li>
</ul>

instead of:

<ul class="menu dhtml_menu menu-root">
  <li id="menu-sub106" class="menutitle expanded"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/" style="display: block; z-index: 2;">film/video</a>
    <div style="display: block;" id="sub106" class="submenu sub-expanded">
      <ul class="menu dhtml_menu">
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">stream</a></li>
        <li class="leaf"><a href="/~rubenbelli/rubenbellinkx_drupal/?q=node/8">mattrass, taps, fire</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">the table turning</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">the musical chair</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">troissoeur</a></li>
      </ul>
    </div>
  </li>
  <li id="menu-sub91" class="menutitle expanded"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/" style="display: block; z-index: 2;">installations</a>
    <div id="sub91" class="submenu sub-expanded" style="display: block;">
      <ul class="menu dhtml_menu">
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">houseplant</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">elephant's ear</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">light - sensitive material</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">the five sinks</a></li>
        <li class="leaf"><a class="active" href="/~rubenbelli/rubenbellinkx_drupal/">rat experiment</a></li>
      </ul>
    </div>
  </li>
</ul>

which is probably the reason it considers it to be 2 separate menu's

eltoneerkens’s picture

I switched to drupal 6. Thanks for your help.

seutje’s picture

wise move I'd say ;)

AjK’s picture

I had a D5 site that needed this functionality. Tried it out and did what it said on the tin. Thanks.

vuil’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

I close this issue as Closed (outdated) because it has not update since 2009.