diff --git a/form.js b/form.js index 487f2bd..7339781 100644 --- a/form.js +++ b/form.js @@ -1,32 +1,12 @@ -var conf = []; -$.getJSON('config.json', function(data) { - conf.push(data); +var conf =[]; +$.getJSON('config.json', function (data) { + conf = data.data; }); -$('#form_people').select2({ - minimumInputLength: 2, - escapeMarkup: function(markup) { - return markup; - }, - templateResult: function(data) { - return data.text; - }, - templateSelection: function(data) { - return data.text; - }, - ajax: { - url: function() { return conf.server + $('#type').val() + '/' }, - dataType: 'json', - processResults: function (data) { - return { results: process(data) }; - } - } -}); - -$('body').on('submit', 'form#person-form', function(event) { +$('body').on('submit', 'form#person-form', function (event) { event.stopPropagation(); event.preventDefault(); var link = $('select#form_people').val(); - console.log( link ); - insertLink ( link ); + console.log(link); + insertLink (link); }); \ No newline at end of file