     newBounds
 
   didInsertElement: ->
-    component = @
-
     Ember.run.scheduleOnce 'afterRender', @, =>
       sdViewer = new OpenSeadragon
         hash: @elementId

          return if @isDestroying
          Em.run.debounce @, @timestampImage, 200
      sdViewer.addHandler 'canvas-drag', (info) =>
        component.sendAction 'sdBounds', sdViewer.viewport.getBounds()
      sdViewer.addHandler 'zoom', (info) =>
        component.sendAction 'sdZoom', info.zoom
        if sdViewer.viewport
          component.sendAction 'sdBounds', sdViewer.viewport.getBounds()

      sdViewer.addHandler 'open', (viewer, source) =>
        component.sendAction 'sdOpen', source
        @set 'sdViewport', @get('sdViewer').viewport

        @timestampImage()

    bounds = @get 'bounds-rect'
    viewport = @get 'sdViewport'
    newBounds = new OpenSeadragon.Rect(bounds.x, bounds.y, bounds.width, bounds.height)
    viewport.fitBounds newBounds

  fitToBounds: ( ->
