datatracker/ietf/static/js/upload-session-agenda.js
Paul Selkirk c1e40ff100
feat: Allow entering agenda text directly (#6792)
* feat: Allow entering agenda text directly (#6532)

* fix: Hide label as well as file/text input box

* refactor: Package javascript for static/dist

* fix: Fix test cases broken by view changes

* test: Add test case for entering agenda text

* refactor: assertRedirects
2023-12-20 16:40:13 -06:00

28 lines
971 B
JavaScript

$(document)
.ready(function () {
var form = $("form.my-3");
// review submission selection
form.find("[name=submission_method]")
.on("click change", function () {
var val = form.find("[name=submission_method]:checked")
.val();
var shouldBeVisible = {
upload: ['[name="file"]'],
enter: ['[name="content"]']
};
for (var v in shouldBeVisible) {
for (var i in shouldBeVisible[v]) {
var selector = shouldBeVisible[v][i];
var row = form.find(selector).parent();
if ($.inArray(selector, shouldBeVisible[val]) != -1)
row.show();
else
row.hide();
}
}
})
.trigger("change");
});