properly closes the menu when clicking anywhere not in the pen editor
adds transitions to the popup menu
adds css animation and simplifies y location of popup