fix issue with conditional fieldsets in modals
This commit is contained in:
parent
559fb3fb9d
commit
09a5ab94dd
@ -159,7 +159,7 @@
|
||||
if (!element.dataset.conditionalInput) {
|
||||
throw new Error('Interactive Fieldset needs a selector for a conditional input!');
|
||||
}
|
||||
conditionalInput = document.querySelector(element.dataset.conditionalInput);
|
||||
conditionalInput = document.querySelector('#' + element.dataset.conditionalInput);
|
||||
if (!conditionalInput) {
|
||||
// abort if form has no required inputs
|
||||
throw new Error('Couldn\'t find the conditional input. Aborting setup for interactive fieldset.');
|
||||
|
||||
@ -173,9 +173,9 @@
|
||||
}
|
||||
|
||||
function withPrefixedInputIDs(modalContent) {
|
||||
var idAttrs = ['id', 'for', 'data-conditional-id'];
|
||||
var idAttrs = ['id', 'for', 'data-conditional-input'];
|
||||
idAttrs.forEach(function(attr) {
|
||||
modalContent.querySelectorAll('[' + attr + ']').forEach(function(input) {
|
||||
Array.from(modalContent.querySelectorAll('[' + attr + ']')).forEach(function(input) {
|
||||
var value = element.id + '__' + input.getAttribute(attr);
|
||||
input.setAttribute(attr, value);
|
||||
});
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<fieldset uw-interactive-fieldset data-conditional-input="##{fvId actionView}" data-conditional-value="#{toPathPiece act}">
|
||||
<fieldset uw-interactive-fieldset data-conditional-input=#{fvId actionView} data-conditional-value=#{toPathPiece act}>
|
||||
<legend>
|
||||
_{act}
|
||||
^{w}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user