         e.preventDefault()
         @modal.data('target', this)
         fn = =>
-          @modal.modal()
+          @runModal()
         $.get $el.attr('href'), {modal: true}, fn, 'script'
 
   buildOptions: ->


  initAjaxInput: ->
    if @el.data('image')
      @buildimageOptions()
    if @el.data('result')
      @options.formatResult = (item) => fetchTemplate(@el.data('result'))(item)
    if @el.data('selection')

        results: data
        more: data.length > 0

  buildImageOptions: ->
    @options.formatResult = (item) ->
      html = '<div class="fancy_select-result">'
      html += "<img src='#{item.image}' alt='#{item.text}'>" if item.image
