         @modal.data('target', this)
         fn = =>
           $('#modal_form form input[name$="[name]"]').val(term)
-          @modal.modal()
+          @runModal()
         $.get @el.data('add'), {modal: true}, fn, 'script'
       null
 

        e.preventDefault()
        @modal.data('target', this)
        fn = =>
          @modal.modal()
        $.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')
