toggling between showing and editing states