* chore: Replace flot with highcharts Since flot hasn't been updated since 2014 and was only used in one place. Simplify how highcharts is initialized and used, and re-enable pre-bs5 export functionality. * Fix tests * Remove some console.log statements
30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
$(document)
|
|
.ready(function () {
|
|
var form = $("form.upload-content");
|
|
// review submission selection
|
|
form.find("[name=bofreq_submission]")
|
|
.on("click change", function () {
|
|
var val = form.find("[name=bofreq_submission]:checked")
|
|
.val();
|
|
|
|
var shouldBeVisible = {
|
|
enter: ['[name="bofreq_content"]'],
|
|
upload: ['[name="bofreq_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");
|
|
});
|