Just as the title says, menu items that do not have a menu icon associated with them at all, still have the "Menu Icon" CSS class applied to them.

This presents a problem for me, because my sub-menu-items do not have menu icons on them, and the menu_icon class adds more spacing to compensate for the icons being there. So the sub-items with no icons on them are getting spaced out because they have an empty "menu_icon" CSS class attached to them.

Please check for an icon before adding the menu_icon CSS tags to the menu item's link.

Comments

SpikeX’s picture

Fixed it myself.

menu_icons.module, line 133:

Replace line 133 with this:

  if ($options['menu_icon']['enable'] && !empty($options['menu_icon']['path']) && file_exists($options['menu_icon']['path']))
  {
	  $options['attributes']['class'] = "menu_icon menu-". $form_state['values']['menu']['mlid'];
  }
  else
  {
	  $options['attributes']['class'] = "";
  }

This will fix the issue.

I can't make patch files (don't have the necessary software on Windows), so once you patch it into the project feel free to mark this as fixed. :)

skilip’s picture

Status: Active » Fixed

Committed to HEAD. Thanks!

SpikeX’s picture

No problem. Glad I could help. :)

Status: Fixed » Closed (fixed)

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