summaryrefslogtreecommitdiff
path: root/assets/js/src
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-02-14 16:11:13 -0500
committerFrederic Guillot <fred@kanboard.net>2015-02-14 16:11:13 -0500
commitf7e4c3928aba9cb7f5222cb4af67846312bbb435 (patch)
tree78f5854a0bdc538c977bad718a11d605a4caaca6 /assets/js/src
parent364382b1b58db8bf1bd2c8866e21c869a7a5d6d0 (diff)
Refactoring/simplification of the pull-request about links
Diffstat (limited to 'assets/js/src')
-rw-r--r--assets/js/src/link.js19
-rw-r--r--assets/js/src/task.js22
2 files changed, 22 insertions, 19 deletions
diff --git a/assets/js/src/link.js b/assets/js/src/link.js
deleted file mode 100644
index 31eeafad..00000000
--- a/assets/js/src/link.js
+++ /dev/null
@@ -1,19 +0,0 @@
-Kanboard.Link = (function() {
-
- function on_change() {
- if ($('.behaviour').prop('checked')) {
- $('.link-inverse-label').hide();
- }
- else {
- $('.link-inverse-label').show();
- }
- }
-
- jQuery(document).ready(function() {
- if (Kanboard.Exists("link-edit-section")) {
- on_change();
- $(".behaviour").click(on_change);
- }
- });
-
-})(); \ No newline at end of file
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');
+ }
+ });
+ }
+ });
+
+})();