forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload_statement.js
More file actions
29 lines (27 loc) · 1.07 KB
/
upload_statement.js
File metadata and controls
29 lines (27 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$(document)
.ready(function () {
var form = $("form.upload-content");
// review submission selection
form.find("[name=statement_submission]")
.on("click change", function () {
var val = form.find("[name=statement_submission]:checked")
.val();
var shouldBeVisible = {
enter: ['[name="statement_content"]'],
upload: ['[name="statement_file"]'],
};
for (var v in shouldBeVisible) {
for (var i in shouldBeVisible[v]) {
var selector = shouldBeVisible[v][i];
var row = form.find(selector);
if (!row.is(".row"))
row = row.closest(".row");
if ($.inArray(selector, shouldBeVisible[val]) != -1)
row.show();
else
row.hide();
}
}
})
.trigger("change");
});