Skip to content

Commit

Permalink
Fixed script_edit Add/Remove logic
Browse files Browse the repository at this point in the history
  • Loading branch information
abujeda committed Nov 2, 2023
1 parent 58ed90e commit 701d876
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/dashboard/app/javascript/script_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function fixedFieldEnabled(checkbox, dataElement) {
if (selectedOption.text == textContent) {
enableSelectOptionConfig(configItemLi, true);
} else {
disableSelectOptionConfig(configItemLi);
disableSelectOptionConfig(configItemLi, true);
}
});
}
Expand All @@ -199,7 +199,7 @@ function toggleFixedField(event) {
event.target.disabled = false;
}

function disableSelectOptionConfig(liElement, addButtonDisabled = true) {
function disableSelectOptionConfig(liElement, addButtonDisabled = false) {
liElement.classList.add('list-group-item-danger', 'text-strike');
const addButton = $(liElement).find('[data-select-toggler="add"]')[0];
addButton.disabled = addButtonDisabled;
Expand Down Expand Up @@ -296,7 +296,7 @@ function initSelect(selectElement) {
enableSelectOptionConfig(configItem);
const textContent = $(configItem).find('[data-select-value]')[0].textContent;
if (excludeList.includes(textContent)) {
disableSelectOptionConfig(configItem, false);
disableSelectOptionConfig(configItem);
}
});
}
Expand Down

0 comments on commit 701d876

Please sign in to comment.