Handle document click to hide toolbars