summaryrefslogtreecommitdiff
path: root/assets/js/src/task.js
blob: 2caf81cc7d174a8aaa7bf4aacb69431e28c61c5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Kanboard.Task = (function() {

    jQuery(document).ready(function() {

        if ($(".task-autocomplete").length) {

            $("input[type=submit]").attr('disabled','disabled');

            $(".task-autocomplete").autocomplete({
                source: $(".task-autocomplete").data("search-url"),
                minLength: 2,
                select: function(event, ui) {
                    var field = $(".task-autocomplete").data("dst-field");
                    $("input[name=" + field + "]").val(ui.item.id);

                    $("input[type=submit]").removeAttr('disabled');
                }
            });
        }
    });

})();