Extract out toggleView method into editor.