| 1 |
// $Id: simplemenu.js,v 1.10.2.1 2009/04/01 01:10:13 rz Exp $ |
// $Id: simplemenu.js,v 1.10.2.2 2009/04/01 01:12:53 rz Exp $ |
| 2 |
|
|
| 3 |
Drupal.behaviors.simplemenuAttach = function(context) { |
Drupal.behaviors.simplemenuAttach = function(context) { |
| 4 |
// If detect pop-ups setting is enabled and we are in a pop-up window |
// If detect pop-ups setting is enabled and we are in a pop-up window |
| 6 |
return; |
return; |
| 7 |
} |
} |
| 8 |
|
|
|
// get the element to add the menu to |
|
|
var element = Drupal.settings.simplemenu.element; |
|
|
var menu = $(simplemenu).attr("id", "simplemenu").addClass('clear-block'); |
|
|
|
|
|
switch (Drupal.settings.simplemenu.placement) { |
|
|
case 'prepend': |
|
|
$(menu).prependTo(element); |
|
|
break; |
|
|
case 'append': |
|
|
$(menu).appendTo(element); |
|
|
break; |
|
|
case 'replace': |
|
|
$(element).html(menu); |
|
|
break; |
|
|
} |
|
|
|
|
| 9 |
$('body').addClass('simplemenu-enabled'); |
$('body').addClass('simplemenu-enabled'); |
| 10 |
|
|
| 11 |
var animation = {}; |
var animation = {}; |
| 12 |
animation[Drupal.settings.simplemenu.effect] = 'toggle'; |
animation[Drupal.settings.simplemenu.effect] = 'toggle'; |
| 13 |
|
|
| 14 |
// Build menu |
// Build menu |
| 15 |
$(menu) |
$('#simplemenu') |
| 16 |
.superfish( { |
.superfish( { |
| 17 |
animation: animation, |
animation: animation, |
| 18 |
delay: Drupal.settings.simplemenu.hideDelay, |
delay: Drupal.settings.simplemenu.hideDelay, |