Renamed togglePanel to itemClicked.