mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Add typeahead suggest to the merge request form
Add the typeahead implementation we already use for the package search to the merge target text field. Instead of suggesting packages, suggest package base names. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
48ae736068
commit
0a357a7d44
3 changed files with 56 additions and 2 deletions
|
@ -23,6 +23,7 @@
|
|||
</select>
|
||||
</p>
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/js/bootstrap-typeahead.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function showHideMergeSection() {
|
||||
if ($('#id_type').val() == 'merge') {
|
||||
|
@ -34,6 +35,18 @@
|
|||
|
||||
$(document).ready(function() {
|
||||
showHideMergeSection();
|
||||
|
||||
$('#id_merge_into').typeahead({
|
||||
source: function(query, callback) {
|
||||
$.getJSON('<?= get_uri('/rpc'); ?>', {type: "suggest-pkgbase", arg: query}, function(data) {
|
||||
callback(data);
|
||||
});
|
||||
},
|
||||
matcher: function(item) { return true; },
|
||||
sorter: function(items) { return items; },
|
||||
menu: '<ul class="pkgsearch-typeahead"></ul>',
|
||||
items: 20
|
||||
}).attr('autocomplete', 'off');
|
||||
});
|
||||
</script>
|
||||
<p id="merge_section">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue