             select: @_onSelect,
             source: @options.source,
             delay: @options.delay,
-            showAtCaret: true
+            showAtCaret: @options.showAtCaret
         )
         @_initValue()
         @_initEvents()


            @start = match.index
            @end = match.index + match[0].length

            if @options.showAtCaret
                range = sel.getRangeAt 0
                boundary = range.cloneRange()
                boundary.setStart node, @start
                boundary.collapse true
                boundary.insertNode @marker
                boundary.detach()
                @options.position.of = @marker

            value = match[1]
        return $.ui.autocomplete.prototype.search.call(@, value, event)

    close: (event) ->
        @marker.remove()
        @element.change()
        return $.ui.autocomplete.prototype.close.call(@, event)

    _renderItem: (ul, item) ->
        li = $('<li>')

            anchor.append("<img src=\"#{item.image}\" />")
        anchor.append(item.value)
        return li.appendTo(ul)

    _setDropdownPosition: (node) ->
        if @options.showAtCaret
            boundary = document.createRange()
            boundary.setStart node, @start
            boundary.collapse true
            rect = boundary.getClientRects()[0]
            @options.position.of = document
            @options.position.at = "left+#{rect.left} top+#{rect.top+rect.height}"
)


