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.
When used in a horizontal menu, sublinks normally expand and collapse on hover. As far as I see with this module, the block does not collapse by itself, would be great to have that feature available as an option. Thanks, great module!
Comment | File | Size | Author |
---|---|---|---|
#14 | menu-attach-block-ui-improve-new-features-2000374-14.patch | 19.77 KB | bamberjp |
#12 | menu_attach_block-7.x-1.x-dev (022615-02).zip | 16.56 KB | bamberjp |
#11 | menu_attach_block-7.x-1.x-dev (022615).zip | 16.55 KB | bamberjp |
#6 | 2000374-auto-collapse-block-6.patch | 14.1 KB | Cameron Tod |
#5 | 2000374-auto-collapse-block.patch | 17.31 KB | Cameron Tod |
Comments
Comment #1
Yuri CreditAttribution: Yuri commentedThis issue is actually about the hover functionality of auto-expand and collapse. It is useful for a menu to auto collapse and expand on hover.
Comment #2
tisteegz CreditAttribution: tisteegz commentedI second this. It would be a great feature to be able to have menu items automatically collapse.
Comment #3
bamberjp CreditAttribution: bamberjp commentedI have made several modifications to enhance this module for a project I am currently working on and wanted to share the results. This version includes configuration options for auto-expand/collapse, hover/click trigger and the ability to make the link itself the droplink. Hopefully this will help further the modules development. Thanks for the great module. - John
Comment #4
bamberjp CreditAttribution: bamberjp commentedI've made a small change to menu_attach_block.js so that the animation is differed until after ajax content is loaded successfully. Best - John
Comment #5
Cameron Tod CreditAttribution: Cameron Tod commentedThanks for the patch, bamberj!
There's quite a lot of changes here, so I've tried to convert the indents to the Drupal coding standards ones to make things a little easier to compare.
Comment #6
Cameron Tod CreditAttribution: Cameron Tod commenteddrupalcbf to the rescue - more style cleanup. Hopefully we can now see only the actual code changes :)
Comment #8
Cameron Tod CreditAttribution: Cameron Tod commentedThis has now been merged into head. I'll go ahead and do a new release now that incorporates this :)
Thanks bamberj!
Comment #9
bamberjp CreditAttribution: bamberjp commentedAwesome and thanks for the great module. My project required that the block automatically collapse when clicking outside of the parent
<li>
, so I've added the following code on my local copy to menu_attach_block.js,Thought this may be useful to others as well. Best - John
Comment #10
bamberjp CreditAttribution: bamberjp commentedI've noticed an issue on anchors with class
expand-on-click
not retracting their attached block due to the hover out callback not being fired. I believe this is due to the content withinmenu-attach-block-wrapper
expanding the width of the<li>
. Additionally, the "if click outside, collapse" snippet I've previously provided doesn't take into account anchors with the classexpand-on-click
and will collapse expanded hovers when clicking on contents within theirmenu-attach-block-wrapper
.Here is an updated version of menu_attach_block.js,
Feedback welcome. Best - John
Comment #11
bamberjp CreditAttribution: bamberjp commentedI've made a few more modifications from the current dev to meet my project requirements. Thought they may be useful to others as well.
Changes:
<block>
and<droplink>
paths and added<void>
option. Solved the first part of 2258157 by replacing<block>
with "Disable Link" checkbox. Now have Droplink radio field that will alter the output accordingly (void link click to expand/collapse block, link with path and hover to expand/collapse block, external link click to expand/collapse block and external link hover to expand/collapse block).Best - John
Comment #12
bamberjp CreditAttribution: bamberjp commentedMinor fix in
menu_attach_block_link
. Best - JohnComment #13
Cameron Tod CreditAttribution: Cameron Tod commentedHi bamberj - would it be possible for you to post these as patch files? It makes it much easier for me to quickly review them and (hopefully) add them onto the module trunk.
https://www.drupal.org/node/707484
Comment #14
bamberjp CreditAttribution: bamberjp commentedPlease find the attached requested patch. This patch includes additional modifications to improve the UI. Additional validation has also been added to prevent the attachment of the menu which parents the link (recursive). I have added the ability to generate both the link as a droplink and add an external link with different triggers which may be beneficial for this modules translation to mobile formatting. Best, John