* Port from 6.x changes. Check that $(element) is not empty to proceed.
This commit is contained in:
parent
4d9851e410
commit
000cc37f2f
@ -11,9 +11,17 @@ Drupal.behaviors.simplemenuAttach = {
|
|||||||
if ($('body').hasClass('simplemenu-enabled')) {
|
if ($('body').hasClass('simplemenu-enabled')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$('body').addClass('simplemenu-enabled');
|
||||||
|
|
||||||
|
|
||||||
// get the element to add the menu to
|
// get the element to add the menu to
|
||||||
var element = settings.simplemenu.element;
|
var element = settings.simplemenu.element;
|
||||||
|
if ($(element).length == 0) {
|
||||||
|
// this happens when you open a pop-up or a different theme
|
||||||
|
// that does not have such an element or the named element
|
||||||
|
// just does not exist in the first place.
|
||||||
|
return;
|
||||||
|
}
|
||||||
var menu = $(simplemenu);
|
var menu = $(simplemenu);
|
||||||
|
|
||||||
switch (settings.simplemenu.placement) {
|
switch (settings.simplemenu.placement) {
|
||||||
@ -28,8 +36,6 @@ Drupal.behaviors.simplemenuAttach = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('body').addClass('simplemenu-enabled');
|
|
||||||
|
|
||||||
var animation = {};
|
var animation = {};
|
||||||
animation[settings.simplemenu.effect] = 'toggle';
|
animation[settings.simplemenu.effect] = 'toggle';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user