toggle between editing and showing states