Fixing expanding/collapse CMS menu targeting wrong element

If a user clicks the log out button (for example) and the menu is
collapsed, the menu expands and then you have to press log out
again