Here's my situation:
I have minipanels configured to stay open for 1000ms after hover-out.
But, I have 3 minipanels that overlap in some arbitrary way.
This means I can have 3 minipanels showing up at the same time, overlapping and looking bad, if i move my mouse quickly enough over all 3 menu items.

What I'd like to have happen is that, when hovering over a minipanel-link, any open minipanels get hidden immeidately, instead of waiting for the configured time.

What's the best way to do this?
Would it require patching this module, or would it somehow be supported via qtip api?

Comments

aaronbauman’s picture

This doesn't work:

Drupal.behaviors.menuMiniPanelsCallbacks = function() {
  MenuMiniPanels.setCallback('beforeRender', function(qTip, event, content) {
    $('.qtip').each(function(){
      $(this).qtip('hide')
    });
  });
}
aaronbauman’s picture

Status: Active » Fixed

This works:

Drupal.behaviors.menuMiniPanelsCallbacks = function() {
  MenuMiniPanels.setCallback('onShow', function(qTip, event, content) {
    $('.qtip').each(function() {
      if ($(this).attr('qtip') != qTip.id) { // don't hide the qtip that's currently being shown
        $(this).hide();
      }
    });
  });
}

The animation is not too clean, but it'll do.

notes:
* "beforeRender" doesn't work because each qtip only gets rendered the first time it's shown. After that, it's just show/hide -- no rendering.
* "beforeShow" is already registered by menu_minipanels.js, so i used "onShow" instead so I didn't mess with that binding

Status: Fixed » Closed (fixed)

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