summaryrefslogtreecommitdiff
path: root/assets/js/components
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-11-02 15:41:58 -0700
committerFrederic Guillot <fred@kanboard.net>2017-11-02 15:41:58 -0700
commit648dc6bcfbdd44947ec58e2f3662c1cc3844d782 (patch)
treed122630decf0bf4a7a199798835481592424a3b0 /assets/js/components
parent44ae87ac0e9bb37ca6d2b305d410758ff71b42c6 (diff)
Add predefined templates for task descriptions
Diffstat (limited to 'assets/js/components')
-rw-r--r--assets/js/components/template.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/assets/js/components/template.js b/assets/js/components/template.js
new file mode 100644
index 00000000..c9ca9ab6
--- /dev/null
+++ b/assets/js/components/template.js
@@ -0,0 +1,11 @@
+KB.onClick('.js-template', function (e) {
+ var template = KB.dom(e.target).data('template');
+ var target = KB.dom(e.target).data('templateTarget');
+ var targetField = KB.find(target);
+
+ if (targetField) {
+ targetField.build().value = template;
+ }
+
+ _KB.controllers.Dropdown.close();
+}); \ No newline at end of file