summaryrefslogtreecommitdiff
path: root/static/js/kosten.ls
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/kosten.ls')
-rw-r--r--static/js/kosten.ls18
1 files changed, 18 insertions, 0 deletions
diff --git a/static/js/kosten.ls b/static/js/kosten.ls
index ea433a4..f9876f8 100644
--- a/static/js/kosten.ls
+++ b/static/js/kosten.ls
@@ -58,6 +58,24 @@ $ !->
$ \input.search .focusout !->
$ \form.search .hide!
+# Consts
+export editConstJS = jq !->
+ group = $ \select#group
+ category = $ \select#category
+
+ group .change !->
+ val = group .find \option:selected .val!
+ if category_data[val] == void # no group selected
+ category .prop \disabled false
+ else
+ category
+ ..find \option:selected .prop \selected false
+ ..find "option[value=#{category_data[val]}]" .prop \selected true
+ ..prop \disabled true
+
+ # initial
+ group .change!
+
# Add
export addJS = jq !->
$ 'input[name=date]'