             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}"
 )
 
 

            focus: @options.focus
        @options.select = $.proxy(@selectCallback, @)
        @options.focus = $.proxy(@focusCallback, @)

        @marker = $("<span id='__autocomplete-marker'/>")[0]

        $.ui.autocomplete.prototype._create.call(@)
        @matcher = new RegExp(@options.matcher + '$')

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