That close button is to remove the projects from the menu, and not to close the menu, so it is a particular feature of the Recent projects menu, which doesn't even need to work with this code, and should stay where is implemented. This would be just to open and close both menus when clicking on the button/link.