Making sure we don't attempt to close a revealing panel unless the panel is visible