Callback beforeOpen toe xecute code before showing menu