   KEY_DOWN: 40
   KEY_ENTER: 13
   KEY_ESC: 27
-  
+
   constructor: (@parent, @selector, @result_callback) ->
     @active_result = null
     self = this

    @old_query = query



class OUT.QuickJump.Base
  DELAY_BEFORE_SERVER_CALL: 300
  FETCHING_RESULTS: "fetching"
  DICTIONARY_KEY_LENGTH: 1
  MAX_RESULTS: 10

  constructor: (@result_callback, @data_url = "/quick_jump_targets.json", selector = "#quick-jump-template") ->
    @dictionary = new OUT.QuickJump.Dictionary(@DICTIONARY_KEY_LENGTH)
    @selector = this.cloneModal(selector)
    @controls = new OUT.QuickJump.Controls(this, @selector, @result_callback)
    this.setDefaultResults()

    self = this
    $(@selector).bind "hidden", ->
      $(self.selector).remove()

    $(@selector).bind "shown", ->
      $(self.selector+" input").select()

    $(@selector).modal().modal("show")

  activateResult: (anchor) ->
    anchor or= this.getActiveResult()

      result = @results[index]
      @result_callback.apply(null, [result])

  getActiveResult: ->
    if @active_result?
      all = $(@selector+" .result")
