       this.getActiveResult().addClass "active"
 
   moveSelection: (modifier) ->
-    console.log "moveSelection", @active_result, @results.length, @MAX_RESULTS
-    max_result = Math.min(@results.length, @MAX_RESULTS)
+    max_result = this.getMaxResult()
     @active_result += modifier
     @active_result = max_result-1 if @active_result < 0
     @active_result = 0 if @active_result > max_result-1

    out = this.renderResultsToString(query)
    if out != ""
      out += '<li class="divider after-results"></li>'
    # if query == ""
    if query == ""
      out += ('<li><a href="/%{type}s">'+@parent.index_link+'</a></li>').replace(/%\{type\}/g, @parent.type).replace(/%\{query\}/g, query)
    else
      out += ('<li><a href="/%{type}s/new?%{type}[title]=%{query}"><i class="icon-plus"></i> '+@parent.new_template+'</a></li>').replace(/%\{type\}/g, @parent.type).replace(/%\{query\}/g, query)
    #  out += '<li class="divider"></li>'

    last_li = $(@selector).find("li.insert-results-after")
    last_li.nextAll().remove()



class OUT.QuickJump.Dropdown extends OUT.QuickJump.Base
  MAX_RESULTS: 20
  constructor: (@dropdown) ->
    @data_url = $(@dropdown).data("target-url")
    @type = $(@dropdown).data("target-type")
