New behavior for Admin Menu Dropdown
markus_petrux - March 16, 2008 - 15:10
| Project: | Administration Menu Dropdown |
| Version: | 5.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Deciphered |
| Status: | closed |
Jump to:
Description
Hi,
I've been using a javascript snippet with this module to toggle admin menu visibility. It's pretty small and uses jQuery. Maybe you could add something like this.
Here's the snippet I use, if anyone want to give it a try:
if (Drupal.jsEnabled) {
Drupal.admin_menu_fix = {
init: function() {
$("div#admin-menu").children("ul:first").children("li:gt(0)").hide();
$("div#admin-menu").width("24px").height("24px").css("overflow","hidden");
$("img.admin-menu-icon").attr("src","/favicon.ico").css("cursor","pointer").title("Click here to toggle administration menu visibility!");
$("li.admin-menu-icon:first a:first").css("padding","4px");
Drupal.admin_menu_fix.is_ready = true;
Drupal.admin_menu_fix.is_collapsed = true;
$("li.admin-menu-icon:first a:first").click(function() {
this.blur();
if (!Drupal.admin_menu_fix.is_ready) return;
Drupal.admin_menu_fix.is_ready = false;
if (Drupal.admin_menu_fix.is_collapsed) {
$("div#admin-menu").width("100%").css("overflow","visible").children("ul:first").children("li:gt(0)").show();
Drupal.admin_menu_fix.is_collapsed = false;
}
else {
$("div#admin-menu").width("24px").css("overflow","hidden").children("ul:first").children("li:gt(0)").hide();
Drupal.admin_menu_fix.is_collapsed = true;
}
Drupal.admin_menu_fix.is_ready = true;
return false;
});
}
};
$(document).ready(Drupal.admin_menu_fix.init);
}As it is, just place into any .js file, i.e. admin_menu_toggle.js and then something like the following in your page.tpl.php script.
<?php if (user_access('access administration menu')) : ?>
<script type="text/javascript" src="<?=base_path() . path_to_theme()?>/js/admin_menu_toggle.js"></script>
<?php endif; ?>Adjust path to suit your needs.
Cheers

#1
I think this feature request is more appropriate for the Administration Menu Dropdown enhancement module. Thus, moving over there.
#2
Looking into this as a secondary mode.
#3
New behavior added to 5.x-2.x-dev and 6.x-2.x-dev which should be available shortly.
#4
Automatically closed -- issue fixed for two weeks with no activity.