Hello, I would like to ask if the "Keep only one menu open at a time." option could affect just each menu and not all of them, so expanding or collapsing in one menu won't affect others. For example when I open/close something in primary links or book navigation, the navigation menu remains open.

Maybe the option could be changed into two options: "Keep only one menu open at a time for all menus" and "Keep only one menu open at a time on same menu". Thank you!

Comments

seutje’s picture

StatusFileSize
new4.51 KB

hmm, I haven't yet made it as a selectable option, but if u want only the siblings of the same menu to be closed, use the attached .js

basicly all I did was change this line

var siblings = $('ul.menu li.expanded').not('.own-children-temp').not(':has(#' + id + ')');

into this

var siblings = $(li).parent().find('li.expanded').not('.own-children-temp').not(':has(#' + id + ')');

I'll try to make it into a selectable option and make a proper .patch, but I've never made a .patch in my life so don't expect this withing 10 minutes :x

seutje’s picture

Status: Active » Needs review
StatusFileSize
new3.18 KB

k, so I tried adding the options n stuff and it seems to work properly

also tried to pack it into a nice .patch file (which was the first time I ever did that so it took me ages to figure it out)

but here goes

this patch should add an option called "Interpret the above option as per-menu" right below the "Keep only one menu open at a time." option
I'm not sure if this would be the best way to describe it but it basically makes open submenus that don't have the same parent as the menu u clicked stay open

when "Keep only one menu open at a time." isn't selected, this option will be ignored.

btw, this is pretty much my first contrib ever... I'm scared :x

daniorama’s picture

Hey, thanks! Your changes worked wonderful! Unfortunately your patch don't, but maybe it was my failure. Some of the changes could not be applied by the patch, so I just changed the files manually and everything worked well.

Maybe someone else could try your patch. I just used cygwin and "patch -p0 < dhtml_menu.patch", then the changes in dhtml_menu.admin.inc were applied but in dhtml_menu.js and dhtml_menu.module were rejected. Don't be scared and thank you again, I hope your patch will be applied in the next version.

seutje’s picture

StatusFileSize
new3.37 KB

yeh, found the problem

I downloaded the dev version off the project page, and made the changes in that, but I made the patch against the CVS repository version

lemme try that again

tbh, I'm just glad some1 tried it :p

k, I made the changes to the right version this time and I changed the head (dunno if I was suppose to)

daniorama’s picture

Status: Needs review » Patch (to be ported)

Patch and Code working great! Thank you very much!

cburschka’s picture

Status: Patch (to be ported) » Needs work

I like this idea, and it's implemented nicely too! UI-wise, it would be ideal to move this effectively 3-state option into 3 radio buttons rather than 2 checkboxes, but that would require a large amount of additional logic and break the simplicity of the single effects setting. Not really worth it.

Please fix indentation, especially in the JS file. Drupal code convention does not allow \t, but rather uses two spaces for each level of indentation. Once that's done, it can get in!

wretched sinner - saved by grace’s picture

subscribe

seutje’s picture

StatusFileSize
new3.37 KB

like this?

manually edited it coz I was too lazy to remake the patch

seutje’s picture

Status: Needs work » Needs review
cburschka’s picture

Status: Needs review » Needs work

Sorry, the patch isn't applying.

Take my word for it, manually editing a patch so that it still applies is far, far harder than rerolling it.

cburschka’s picture

Found the problem. You're messing with the File $Id$ comments. Leave them alone. CVS will take care of them.

seutje’s picture

StatusFileSize
new2.81 KB

oh ok, lemme try it again

cburschka’s picture

Um, no; the last CVS commit was made back in August. It's been a quiet few months for this module.

I'm fairly sure the DRUPAL-6--3 and HEAD branches are identical right now, too. They ought to be - HEAD isn't chasing D7 yet.

seutje’s picture

Status: Needs work » Needs review

yeh, I just noticed that as I did another checkout ;)

looked at what the patch spit out and it looks like it went proper

cburschka’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new5.34 KB

Used a better description for this setting, and updated the localization template.

seutje’s picture

oh yeah, I didn't rly think about translation stuffs :x

senku ^^

cburschka’s picture

Made a CVS ID mistake myself. This patch will apply to HEAD and DRUPAL-6--3.

cburschka’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD and DRUPAL-6--3.

A stable version will be released pending #280843: More flexibility for enabling/disabling DHTML effect

Status: Fixed » Closed (fixed)

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