Skip to content

Commit

Permalink
Radio optional blocks now animate in/out
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Nov 6, 2021
1 parent 1c09b8d commit cea8325
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion core/src/main/resources/lib/form/radioBlock/radioBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ var radioBlockSupport = {
n = blockStart;
}
while((n = n.next()) != blockEnd) {
n.style.display = show ? "" : "none";
if (show) {
n.classList.remove("form-container--hidden")
} else {
n.classList.add("form-container--hidden")
}
}
layoutUpdateCallback.call();
}
Expand All @@ -27,6 +31,7 @@ var radioBlockSupport = {
// this needs to happen before TR.row-set-end rule kicks in.
Behaviour.specify("INPUT.radio-block-control", 'radioBlock', -100, function(r) {
r.id = "radio-block-"+(iota++);
r.nextSibling.setAttribute("for", r.id);

// when one radio button is clicked, we need to update foldable block for
// other radio buttons with the same name. To do this, group all the
Expand Down
2 changes: 1 addition & 1 deletion war/src/main/js/widgets/config/model/ConfigRowGrouping.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ConfigRowGrouping.prototype.findToggleWidget = function(row) {
var input = $(':input.block-control', row);
if (input.length === 1) {
this.toggleWidget = input;
this.label = input.parent().find('label').text();
this.label = input.next().text();
input.addClass('disable-behavior');
}
};
Expand Down

0 comments on commit cea8325

Please sign in to comment.