Skip to content

Commit

Permalink
Reorder per review comment
Browse files Browse the repository at this point in the history
Signed-off-by: Yarden Shoham <git@yardenshoham.com>
  • Loading branch information
yardenshoham committed Mar 9, 2024
1 parent 4af858f commit 4d1ffda
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions web_src/js/features/comp/WebHookEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ export function initCompWebHookEditor() {
});
}

const updateContentType = function () {
const visible = document.getElementById('http_method')?.value === 'POST';
toggleElem(document.getElementById('content_type')?.parentNode.parentNode, visible);
};
updateContentType();
const httpMethodInput = document.getElementById('http_method');
if (httpMethodInput) {
const updateContentType = function () {
const visible = httpMethodInput.value === 'POST';
toggleElem(document.getElementById('content_type')?.parentNode.parentNode, visible);
};
updateContentType();

document.getElementById('http_method')?.addEventListener('change', updateContentType);
httpMethodInput.addEventListener('change', updateContentType);
}

// Test delivery
document.getElementById('test-delivery')?.addEventListener('click', async function () {
Expand Down

0 comments on commit 4d1ffda

Please sign in to comment.