Do not add the id="simplemenu" in JavaScript. Do it in PHP instead.

Added a new superfish parameter added in 1.4.8 (not present in 1.4.1 so it
has not side effect to the old version.)
This commit is contained in:
Alexis Wilke 2010-05-15 10:38:40 +00:00
parent c198b6f75f
commit 202280fa6b

View File

@ -12,7 +12,7 @@ Drupal.behaviors.simplemenuAttach = function(context) {
// get the element to add the menu to // get the element to add the menu to
var element = Drupal.settings.simplemenu.element; var element = Drupal.settings.simplemenu.element;
var menu = $(simplemenu).attr("id", "simplemenu").addClass('clear-block'); var menu = $(simplemenu);
switch (Drupal.settings.simplemenu.placement) { switch (Drupal.settings.simplemenu.placement) {
case 'prepend': case 'prepend':
@ -33,11 +33,13 @@ Drupal.behaviors.simplemenuAttach = function(context) {
// Build menu // Build menu
$(menu) $(menu)
.find('#simplemenu')
.superfish({ .superfish({
pathClass: 'current', pathClass: 'current',
animation: animation, animation: animation,
delay: Drupal.settings.simplemenu.hideDelay, delay: Drupal.settings.simplemenu.hideDelay,
speed: Drupal.settings.simplemenu.effectSpeed speed: Drupal.settings.simplemenu.effectSpeed,
autoArrows: false
}) })
.find(">li:has(ul)") .find(">li:has(ul)")
.mouseover(function(){ .mouseover(function(){