When a menu minipanel is triggered, then hovered, the triggering menu item loses it's CSS :hover state. Since we can't through Javascript continue to trigger the :hover state we should instead apply a CSS class of .hover, so that themes can continue displaying a hover state on the triggering menu item.
For an example of this see Sound+Vision's menu mini panels. When you hover on the main menu there is a hover state on the menu item. When you then mouse over the menu mini panel the menu item remains themed as though it is hovered (due to a .hover being applied).
Patch to be included in next comment.
Comments
Comment #1
codycraven commentedPatch attached, created with git format-patch.
Comment #2
Sinan Erdem commentedjust the feature I was looking for. Thanks... Works well...
Comment #3
codycraven commentedComment #4
vood002 commentedI was able to apply this patch to D6 as well, tested fine for me.
DidDidn't try running patch, just added code manually FYI.Comment #5
damienmckennaI'll review this and #1045578: Leave parent menu item "hover" active this weekend and will commit the code that works the best.
BTW, nice to see Bonnier using this module :)
Comment #6
amitaibuI think this is a better patch :)
Comment #7
codycraven commentedAmitaibu, I haven't tried the patch but indeed it looks much better, I didn't realize there was a callback.
Comment #8
pbfleetwood commented@DamienMcKenna, do you have an idea which of these patches (#1 or #6) will be committed? I figure that I may as well be testing my site with the one that will be in the production release. Thanks.
Comment #9
pbfleetwood commentedDoes anyone have further comment on these patches, specifically whether one is preferred over the other?
It doesn't look like either is going to be committed. :(
Comment #10
sakadava commented#1 worked for me.
#6 removed the active state of menu items which were already active (but changing the affected class from "active" to "hover" made #6 work correctly in my situation). Should the affected class in #6 be "hover" rather than "active"?
Comment #11
damienmckenna"hover" would be the correct term to use. I'll be reviewing this issue this week.
Comment #12
jwilson3I agree with #10 and #11, that "hover" is clearly the semantic behavior being implemented here, however replacing "active" with "hover" in patch #6 is redundant information, since the "qtip-hover" class is already there.
I would just stick with "qtip-hover" as the default hover class, and make the hover-state class name(s) extendible/overridable either through the admin UI, or through custom styles in
menu_minipanels_styles.jsin your own theme or module.Also, I'm not sure we need the hover state to apply to the parent item (per patch in #6) either, which just makes the code more complicated. We can use the
qtip.options.activatorto find the element to which we should apply the hover state.Patch provided.
Comment #13
jwilson3Was having issues using shorthand
$in the default callback, and tho I'm not entirely sure why, here is a re-roll that uses the longhand form, that didn't have any issues.Comment #14
damienmckenna@jwilson3: the
$shorthand won't work because it's outside of the(function($) {})(jQuery);bit.Comment #15
jwilson3yep, good point. Would it make sense to move the closing line of the jQuery -> $ mapping section to the absolute bottom of the file?
Comment #16
damienmckenna@jwilson3: try it locally first, I don't believe it worked when I tried BICBW.
Comment #17
jwilson3Patch in #13 updated with changes from #15; worked fine for me here.
Comment #18
jwilson3Ugh, forgot to strip out sites/all/modules/contrib... from the patch,... here's a cleaner one.
Comment #19
damienmckennaA few changes:
This patch is for D7, a D6 patch is on the way.
Comment #20
damienmckennaI added a "Tips" section to the README.txt file which mentions the "qtip-hover" class that's added to the menu item. I've also included a patch for D6.
Comment #21
damienmckennaThanks to everyone who contributed to working out the best solution for this, the patches from #20 have been committed.
Comment #23
jwilson3Anyone participating on this issue should definitely update to the latest release candidate and use the qtip-hover class! It rocks, however, I've just filed a follow-up related issue that I'm experiencing on sites where I'm using the qtip-hover.
Please checkout #1425046: Qtip-hover state is sticking. Your feedback is appreciated.
Comment #24
prakashsingh commentedIn reference to #20, can u explain what below line means:-
drupal_add_js(drupal_get_path('module', 'mymodule_styles') . '/menu_minipanels_styles.js', array('scope' => 'footer'));does it mean, one new module to be added? am i write? If yes then wat are the content of the new module?
Regards
Comment #25
jwilson3That line by itself means a while lot of nothing and is out of context. It is part of the API.txt, if you want to implement your own qtip settings, you need to put them inside a javascript file in a custom module that implements hook_menu_minipanels_style ("mymodule" is used as an example implementation).
Comment #26
prakashsingh commentedThanks jwilson3,
So that means while simply applying the patch we should ignore :
Comment #27
prakashsingh commentedHi there..
Is this module ready to use, i mean, if i download the latest dev; do i need to apply the patch from #20 or it is already applied to the code.
I am asking this, becoz i applied the patch to the menu_minipanels.js but no luck. After going thru a number of times, #20 looks to me confusing and i think i m missing something interesting.
Plz help....
Comment #28
maxplus commentedHi,
this feature would also be great in the 7.x-2.x version.