Moving local tasks to the admin menu works by moving all the LI elements inside a UL. However the UL element remains, so any CSS applied on the UL stays around. In my case there is a margin and bottom border which makes the page look a bit odd.

I suggest removing the UL altogether from the DOM after moving the LI elements. Thanks

Comments

sun’s picture

Patch?

mr.j’s picture

This should work as it is an extremely simple 1 line fix (untested):

    // Move page tabs into administration menu.
    if (Drupal.settings.admin_menu.tweak_tabs) {
      $('ul.tabs.primary li').each(function() {
        $(this).addClass('admin-menu-tab').appendTo('#admin-menu > ul');
      });
      $('ul.tabs.secondary').appendTo('#admin-menu > ul > li.admin-menu-tab.active');
      $('ul.tabs.primary').remove(); // <------ Added
    }
sun’s picture

mr.j’s picture

Status: Active » Needs review

1. I know how to make a patch. I was not at a dev machine when I tried to help you with a fix off the top of my head (notice it says untested).

2. It is a 1 line fix. Quicker for you to just do manually than bother with another patronising and unhelpful response instead of a little thanks.

3. Best of luck in the future, you've done enough to discourage me from fixing any more of your bugs.

Index: admin_menu.js
===================================================================
--- admin_menu.js	(revision 262)
+++ admin_menu.js	(working copy)
@@ -15,6 +15,7 @@
         $(this).addClass('admin-menu-tab').appendTo('#admin-menu > ul');
       });
       $('ul.tabs.secondary').appendTo('#admin-menu > ul > li.admin-menu-tab.active');
+      $('ul.tabs.primary').remove();
     }
   }
sun’s picture

Title: Move local tasks doesn't move whole menu » Move local tasks leaves stale UL

You might want to have a look at http://drupal.org/project/user/sun - my time permits me to mostly work on issues with patches only. If I'd do all of them myself, hell would break lose.

Glad you edited your comment and removed that li ;)

Now consider what happened if I would have made the mistake. In this case, it may not have led to a failure, but the issue would not be resolved.

mr.j’s picture

Ok then, no thanks for the fix. Cheers

I appreciate you have a lot to do, we all do .. but one word answers and pointing to patch instructions for the simplest of fixes without a hint of appreciation or thanks don't encourage people to participate much.

As for the error in the patch I corrected a minute after posting, good catch but what good is a patch-formatted fix if there is an error in it anyway? Not sure how you could have made the same mistake by copy+pasting a solitary line that I posted correctly originally (and if you think about it your insistence on a patch potentially led to the creation of an error).

sun’s picture

Version: 5.x-2.8 » 5.x-3.x-dev
Status: Needs review » Fixed

Committed a fix for this to 3.x. There won't be another 2.x release for 5.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

traviscarden’s picture

Title: Move local tasks leaves stale UL » "Move local tasks to menu" leaves empty UL
Version: 5.x-3.x-dev » 6.x-1.x-dev
Status: Closed (fixed) » Needs review
StatusFileSize
new939 bytes
new746 bytes

Could we port this forward to 6.x? Attached is a patch. It will conflict with the patch I just submitted at #645526: Keep Themes from Affecting Local Tasks When Moved into Menu because they change lines right before and after each other, so I've also attached a combined patch containing both edits. I'm still fairly new to submitting patches, so please tell me if that's not the most helpful approach. Thanks so much!

sun’s picture

Version: 6.x-1.x-dev » 6.x-3.x-dev
Status: Needs review » Fixed

This seems to be fixed in 3.x already.

Also committed #645526: Keep Themes from Affecting Local Tasks When Moved into Menu

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.