1 /* $Id: admin_menu.js,v 1.7.2.7 2009/01/24 04:59:22 sun Exp $ */
3 $(document).ready(function() {
4 // Apply margin-top if enabled; directly applying marginTop doesn't work in IE.
5 if ($('#admin-menu').size() && Drupal.settings.admin_menu) {
6 if (Drupal.settings.admin_menu.margin_top) {
7 $('body').addClass('admin-menu');
9 if (Drupal.settings.admin_menu.position_fixed) {
10 $('#admin-menu').css('position', 'fixed');
12 // Move page tabs into administration menu.
13 if (Drupal.settings.admin_menu.tweak_tabs) {
14 $('ul.tabs.primary li').each(function() {
15 $(this).addClass('admin-menu-tab').appendTo('#admin-menu > ul');
17 $('ul.tabs.secondary').appendTo('#admin-menu > ul > li.admin-menu-tab.active');
21 // Collapse fieldsets on Modules page. For why multiple selectors see #111719.
22 if (Drupal.settings.admin_menu && Drupal.settings.admin_menu.tweak_modules) {
23 $('#system-modules fieldset:not(.collapsed), #system-modules-1 fieldset:not(.collapsed)').addClass('collapsed');
26 // Hover emulation for IE 6.
27 if ($.browser.msie && parseInt(jQuery.browser.version) == 6) {
28 $('#admin-menu li').hover(function() {
29 $(this).addClass('iehover');
31 $(this).removeClass('iehover');
36 $('#admin-menu li').hover(function() {
38 clearTimeout(this.sfTimer);
39 // Display child lists.
40 $('> ul', this).css({left: 'auto', display: 'block'})
41 // Immediately hide nephew lists.
42 .parent().siblings('li').children('ul').css({left: '-999em', display: 'none'});
45 var uls = $('> ul', this);
46 this.sfTimer = setTimeout(function() {
47 uls.css({left: '-999em', display: 'none'});