Added a function to handle the menu button click

* It opens/closes the menu on click