         acc[doc.name] = translated if translated isnt doc.name
       acc
     , {})
-    
+
     @onMouseMove = _.throttle @onMouseMove, 25
-    
+
   afterRender: ->
     super()
     @ace.on 'mousemove', @onMouseMove

module.exports = class SpellTranslationView extends CocoView
  className: 'spell-translation-view'
  template: template
  
  events:
    'mousemove': ->
      @$el.hide()

  setTooltipText: (text) =>
    @$el.find('code').text text
    @$el.show().css(@pos)

  isIdentifier: (t) ->
    t and (_.any([/identifier/, /keyword/], (regex) -> regex.test(t.type)) or t.value is 'this')

  onMouseMove: (e) =>
    return if @destroyed
    pos = e.getDocumentPosition()
