summaryrefslogtreecommitdiff
path: root/assets/js/components
diff options
context:
space:
mode:
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