         else if isPinned
           unpinNavBar()
         setTocHeight()
-
       Backbone.on('window:optimizedScroll', handleHeaderViewPinning)
+      @on('closing', ->
+        Backbone.off('window:optimizedScroll', handleHeaderViewPinning)
+      )
+
       navView.on('tocIsOpen', (whether) ->
         windowWithSidebar.open(whether)
         # On small screens, when the contents is opened,

        $(window).scrollTop(scrollTo)
      )

    updateSummary: () ->
      abstract = @model.get('abstract')
      if abstract

        $toc.css('top', "#{tocTop}px")
        newHeight = window.innerHeight - tocTop
        $toc.height("#{newHeight}px")
      Backbone.on('window:optimizedResize', setTocHeight)
      @on('closing', ->
        Backbone.off('window:optimizedResize', setTocHeight)
      )

      adjustMainMargin = (height) ->
        mainPage.regions.main.$el.css('margin-top', "#{height}px")

      $titleArea = mediaTitleView.$el.find('.media-title')
      pinNavBar = ->
        $pinnable.addClass('pinned')
        $titleArea.addClass('compact')
        $toc.addClass('pinned')
        isPinned = true
        adjustMainMargin($pinnable.height())
      unpinNavBar = ->
        $pinnable.removeClass('pinned')
        $titleArea.removeClass('compact')
        $toc.removeClass('pinned')
        isPinned = false
        adjustMainMargin(0)
        pinnableTop = $pinnable.offset().top
      mediaTitleView.on('render', ->
        $titleArea = mediaTitleView.$el.find('.media-title')
        $titleArea.addClass('compact') if isPinned
      )

      handleHeaderViewPinning = ->
        top = $(window).scrollTop()
        if top > pinnableTop
