     classnames = ["reference-book"]
     classnames.push('menu-open') if @state.isMenuVisible
     if course and _.findWhere(course.roles, type: 'teacher')
-      showTeacher = @showTeacherEdition
+      toggleTeacher = @toggleTeacherEdition
       teacherLinkText = if @state.showTeacherEdition
         classnames.push('is-teacher')
         "Hide Teacher Edition"

      <NavBar
        toggleTocMenu={@toggleMenuState}
        teacherLinkText={teacherLinkText}
        showTeacherEdition={showTeacher}
        courseId={courseId}/>
      <div className="content">
        <Menu onMenuSelection={@onMenuClick} />

    # Pop open the menu unless the page was explicitly navigated to
    {isMenuVisible: not cnxId}

  toggleTeacherEdition: (ev) ->
    @setState(showTeacherEdition: not @state.showTeacherEdition)
    ev?.preventDefault() # stops react-router from scrolling to top

  onMenuClick: ->
    @toggleMenuState() unless window.innerWidth > MENU_VISIBLE_BREAKPOINT
