Skip to content

Commit

Permalink
mark selectbox as disabled if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Jul 5, 2024
1 parent 3523645 commit 91b0657
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions views/partials/oauth_form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -566,13 +566,19 @@
}
let projectId = projectIdElm.value;
if (projectId) {
let unselected = !pubSubAppElm.value
pubSubAppElm.querySelectorAll('option').forEach(entry => {
if (entry.value && entry.dataset.project !== projectId) {
entry.classList.add('d-none');
entry.disabled = true;
} else {
entry.classList.remove('d-none');
entry.disabled = false;
if (unselected) {
entry.selected = true;
unselected = false;
}
}
});
}
Expand Down

0 comments on commit 91b0657

Please sign in to comment.