Index: CHANGELOG.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/CHANGELOG.txt,v retrieving revision 1.10.2.54 diff -u -p -r1.10.2.54 CHANGELOG.txt --- CHANGELOG.txt 24 Oct 2008 07:37:36 -0000 1.10.2.54 +++ CHANGELOG.txt 2 Nov 2008 18:02:38 -0000 @@ -6,6 +6,7 @@ Admin Menu x.x-x.x, xxxx-xx-xx Admin Menu 5.x-2.x, xxxx-xx-xx ------------------------------ +#310423 by sun: Added optional position: fixed configuration setting. #325057 by sun: Updated README.txt. #324334 by AltaVida: Fixed usernames with spaces not in Devel user switch links. #319382 by betz: Added Dutch translation. Index: admin_menu.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.js,v retrieving revision 1.2.2.11 diff -u -p -r1.2.2.11 admin_menu.js --- admin_menu.js 8 Sep 2008 23:02:35 -0000 1.2.2.11 +++ admin_menu.js 2 Nov 2008 18:02:16 -0000 @@ -2,8 +2,13 @@ $(document).ready(function() { // Apply margin-top if enabled; directly applying marginTop doesn't work in IE. - if ($('#admin-menu').size() && Drupal.settings.admin_menu.margin_top) { - $('body').addClass('admin-menu'); + if ($('#admin-menu').size()) { + if (Drupal.settings.admin_menu.margin_top) { + $('body').addClass('admin-menu'); + } + if (Drupal.settings.admin_menu.position_fixed) { + $('#admin-menu').css('position', 'fixed'); + } } // Collapse fieldsets on Modules page. For why multiple selectors see #111719. Index: admin_menu.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.module,v retrieving revision 1.26.2.31 diff -u -p -r1.26.2.31 admin_menu.module --- admin_menu.module 22 Oct 2008 05:52:19 -0000 1.26.2.31 +++ admin_menu.module 2 Nov 2008 18:02:26 -0000 @@ -81,7 +81,12 @@ function admin_menu_menu($may_cache) { // Performance: Defer execution. drupal_add_js($path .'/admin_menu.js', 'module', 'header', TRUE); - drupal_add_js(array('admin_menu' => array('margin_top' => variable_get('admin_menu_margin_top', 1))), 'setting'); + if ($setting = variable_get('admin_menu_margin_top', 1)) { + drupal_add_js(array('admin_menu' => array('margin_top' => $setting)), 'setting'); + } + if ($setting = variable_get('admin_menu_position_fixed', 0)) { + drupal_add_js(array('admin_menu' => array('position_fixed' => $setting)), 'setting'); + } if ($_GET['q'] == 'admin/build/menu' && variable_get('admin_menu_tweak_menu', 0)) { drupal_add_js($path .'/admin_menu.menu.js'); drupal_add_js('misc/collapse.js'); @@ -103,6 +108,12 @@ function admin_menu_theme_settings() { '#default_value' => variable_get('admin_menu_margin_top', 1), '#description' => t('If enabled, the output of this site will be shifted for approx. 20 pixels from the top of the viewport to make room for the Administration Menu. If this setting is disabled, some absolute or fixed positioned page elements at the top of the viewport may be covered by Administration Menu.'), ); + $form['admin_menu_position_fixed'] = array( + '#type' => 'checkbox', + '#title' => t('Use fixed instead of absolute positioning'), + '#default_value' => variable_get('admin_menu_position_fixed', 0), + '#description' => t('If enabled, the administration menu will always stay at the top of the browser viewport, even if you scroll down the page.') .'
'. t('Note: In some browsers this setting might cause malformed page contents, a disappearing cursor and not editable select lists in forms. If such effects occur, this setting should be disabled.'), + ); $form['tweaks'] = array( '#type' => 'fieldset', '#title' => t('Drupal Administration Tweaks'),