     @_slidesViewer ||= document.querySelector(@identifier)
 
   start: ->
-    if !this.isFile()
-      window.addEventListener('popstate', @handlePopState, false)
-
     @timer.render()
 
     document.addEventListener('click', @handleClick, false)

    imageWait()

  slideFromLocation: ->
    value = if this.isFile()
      location.hash
    else
      location.pathname

    Number(value.substr(1))

  handlePopState: (e) =>
    this.advanceTo(if e.state then e.state.index else this.slideFromLocation())

  handleClick: (e) =>
    this.advance() if e.target.tagName != 'A'

  advance: (offset = 1) =>
    this.advanceTo(Math.max(Math.min(@currentSlide + offset, @length - 1), 0))

  advanceTo: (index) =>
    @priorSlide = @currentSlide
    @currentSlide = index || 0

    this.calculate()

    location.hash = @currentSlide

  calculate: =>
    if @currentWindowHeight != window.innerHeight
