Project:Nice Menus
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I am using "6.x-2.x-dev 2009-May-07" and the "autoArrows: false" switch which is set in the first superfish() call nice_menus.js works, but because superfish() is called again (to include the bgIframe plugin) and it is called without any options, autoArrows returns to its default value of true and the arrows are thus visible.

I would suggest that the JS code should look more like this:

$(document).ready(function() {
  superFishOptions = {
    // Add the legacy hover class added for IE.
    hoverClass: 'ie-over',
    // Disable generation of arrow mark-up.
    autoArrows: false,
    // Disable drop shadows.
    dropShadows: false,
    // Mouse delay.
    delay: Drupal.settings.nice_menus_options.delay,
    // Animation speed.
    speed: Drupal.settings.nice_menus_options.speed
  }
  $('ul.nice-menu').superfish(superFishOptions);
  // Add in Brandon Aaron’s bgIframe plugin for IE select issues.
  // http://plugins.jquery.com/node/46/release
  $('ul.nice-menu').superfish(superFishOptions).find('ul').bgIframe({opacity:false});
});

with the options passed twice. This code works in my tests.

Comments

#1

Agreed - this appears to work for me too.

#2

The "delay" option does not work as well.
And I can confirm that this "patch" fixes it.

#3

I had a really tough time finding this, so here are some search terms someone else might be trying: nice menu displaying guillemets >> raquo &raquo "double arrow"

#4

Title:"autoArrows: false" Does not Appear to Work» Superfish no worky

Yeah the superfish stuff got messed up between the patch and what is in the current dev. If someone could make a patch it would help get this fixed.

#5

I tried this.

Arrows disappeared from expandable menu entries.

However, delay still only works after second hover over the entry.

Has anyone solved this?

Thank you

#6

subscribing

#7

Does anyone notice that when the page loads the double arrows load a little after the menu. This causes an unpleasant jump. Is there a fix for this?

#8

Confirm this as a fix for the arrow issues. Will try to get a patch rolled for commit unless there is a better way to implement this fix.

#9

Personally I'm not having problems with the arrows after applying the above fix, as I already mentioned.
Haven't seen any official response for the fade-in not working for first hover though...

#10

The suggested code is incorrect. You do not need to call .superfish() twice and, in fact, it makes no sense to do so. The code could be written like this:

$(document).ready(function() {
  $('ul.nice-menu').superfish({
    // Add the legacy hover class added for IE.
    hoverClass: 'ie-over',
    // Disable generation of arrow mark-up.
    autoArrows: false,
    // Disable drop shadows.
    dropShadows: false,
    // Mouse delay.
    delay: Drupal.settings.nice_menus_options.delay,
    // Animation speed.
    speed: Drupal.settings.nice_menus_options.speed
  }).find('ul').bgIframe({opacity:false});
});

Also, in JavaScript, when you do not explicitly declare variables, they become implied globals, ending up as properties of the window object, which is rarely what people intend. In other words, use the var keyword to create a local variable.

#11

#10 is OK, I'll try to submit a patch when I come back to a place I have CVS access.

#12

Status:active» needs review

Here we go

AttachmentSize
nice_menus-481814-12.patch 844 bytes

#13

TESTED #12. Works great.

#14

Status:needs review» reviewed & tested by the community

#15

#12 is working for me too - thanks!

#16

So, is this patch now part of the Nice Menus module? Or does it need to be patched if I install 6.x-2.x-dev? Does 6.x-1.3 support Superfish well?

Thank you.

#17

I installed the patch in #12 and it fixed the raquo image problem. Thank you kindly! :)

#18

@cdd23 no it's not committed yet

#19

Status:reviewed & tested by the community» fixed

Committed to HEAD. thanks all! :-)

#20

Status:fixed» closed (fixed)

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