Skip to content

Commit

Permalink
Moves instiation lines for optionFor handlers to optionForHandler fun…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
HazelGrant committed Dec 20, 2024
1 parent a956932 commit eeba467
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/dashboard/app/javascript/dynamic_forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ function snakeCaseWords(str) {
function memorizeElements(elements) {
elements.each((_i, ele) => {
formTokens.push(mountainCaseWords(shortId(ele['id'])));
optionForHandlerCache[ele['id']] = [];
exclusiveOptionForHandlerCache[ele['id']] = [];
});
};

Expand Down Expand Up @@ -545,8 +543,10 @@ function sharedOptionForHandler(causeId, targetId, optionForType) {
let handlerCache = null;

if (optionForType == 'optionFor') {
if (optionForHandlerCache[causeId] == undefined) optionForHandlerCache[causeId] = [];
handlerCache = optionForHandlerCache;
} else if (optionForType == 'exclusiveOptionFor') {
if (exclusiveOptionForHandlerCache[causeId] == undefined) exclusiveOptionForHandlerCache[causeId] = [];
handlerCache = exclusiveOptionForHandlerCache;
}

Expand Down

0 comments on commit eeba467

Please sign in to comment.