diff --git a/admin_menu.js b/admin_menu.js index 65911cf..f8c730a 100644 --- a/admin_menu.js +++ b/admin_menu.js @@ -125,7 +125,7 @@ Drupal.admin.getCache = function (hash, onSuccess) { Drupal.admin.hashes.hash = status; } }); -} +}; /** * @defgroup admin_behaviors Administration behaviors. @@ -172,7 +172,7 @@ Drupal.admin.behaviors.replacements = function (context, settings, $adminMenu) { for (var item in settings.admin_menu.replacements) { $(item, $adminMenu).html(settings.admin_menu.replacements[item]); } -} +}; /** * Inject destination query strings for current page. @@ -183,7 +183,7 @@ Drupal.admin.behaviors.destination = function (context, settings, $adminMenu) { this.search += (!this.search.length ? '?' : '&') + Drupal.settings.admin_menu.destination; }); } -} +}; /** * Apply JavaScript-based hovering behaviors. diff --git a/admin_menu.module b/admin_menu.module index d05e987..d1d9f4a 100644 --- a/admin_menu.module +++ b/admin_menu.module @@ -132,8 +132,11 @@ function admin_menu_init() { if ($user->uid == 1) { drupal_add_css($path . '/admin_menu.uid1.css'); } - // Performance: Defer execution. - drupal_add_js($path . '/admin_menu.js', array('defer' => TRUE)); + // Previous versions used the 'defer' attribute to increase browser rendering + // performance. At least starting with Firefox 3.6, deferred .js files are + // loaded, but Drupal.behaviors are not contained in the DOM when drupal.js + // executes Drupal.attachBehaviors(). + drupal_add_js($path . '/admin_menu.js'); // Destination query strings are applied via JS. $settings['destination'] = drupal_http_build_query(drupal_get_destination());