Move tap handler into if(toggleAutomatically) block

I renamed allowSwipe to toggleAutomatically, because I think this is a better variable name than the one I originally chose. Since when this variable is false, we want to handle opening and closing the menu on our own (perhaps with a button), the TapHandler should not exist. So, I put it inside the block.