From 4ef7d5f93a521f18cd909206e1ca2c5c29ffc222 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 7 Apr 2019 21:13:02 +0200 Subject: [PATCH] refactor Interactive Fieldset JS utility --- static/js/utils/form.js | 100 +++++++++++++----- .../widgets/multi-action/multi-action.hamlet | 2 +- 2 files changed, 73 insertions(+), 29 deletions(-) diff --git a/static/js/utils/form.js b/static/js/utils/form.js index 31b94d1bb..afd0c72e8 100644 --- a/static/js/utils/form.js +++ b/static/js/utils/form.js @@ -177,51 +177,95 @@ setup: reactiveButtonUtil, }); + /** + * + * Interactive Fieldset Utility + * shows/hides inputs based on value of particular input + * + * Attribute: uw-interactive-fieldset + * + * Params: + * data-conditional-input: string + * Selector for the input that this fieldset watches for changes + * data-conditional-value: string + * The value the conditional input needs to be set to for this fieldset to be shown + * + * Example usage: + * + *
...
+ *
...
+ * ## example with + *