add method input field typeahead support
using this bootstrap3 backport of the bold bootstrap2 typeahead component because twitter typeahead.js is poop
This commit is contained in:
parent
30d1e5ccce
commit
90cb98de15
1
resources/public/js/bootstrap3-typeahead.min.js
vendored
Normal file
1
resources/public/js/bootstrap3-typeahead.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -65,6 +65,17 @@ function getAdditionalUrl(form) {
|
|||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('input[data-typeahead-url]').each(function() {
|
||||
var element = $(this);
|
||||
var typeaheadUrl = element.data('typeahead-url');
|
||||
|
||||
element.typeahead({source: function(query, process) {
|
||||
return $.get(typeaheadUrl, { q: query }, function (data) {
|
||||
return process(data);
|
||||
});
|
||||
}});
|
||||
});
|
||||
|
||||
$('form.api-form').submit(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
{{ javascript('/js/jquery.min.js') }}
|
||||
{{ javascript('/js/bootstrap.min.js') }}
|
||||
{{ javascript('/js/bootstrap3-typeahead.min.js') }}
|
||||
{{ javascript('/js/site.js') }}
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
Reference in a new issue