diff options
Diffstat (limited to 'assets/js/src/task.js')
-rw-r--r-- | assets/js/src/task.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/assets/js/src/task.js b/assets/js/src/task.js new file mode 100644 index 00000000..2caf81cc --- /dev/null +++ b/assets/js/src/task.js @@ -0,0 +1,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'); + } + }); + } + }); + +})(); |