Add ManufacturerId_onchange and ModelId_onchange to hide/show the text input for custom entry

This commit is contained in:
Isaac Connor 2021-07-07 09:47:32 -04:00
parent c6209ce460
commit 54f676a501
1 changed files with 13 additions and 1 deletions

View File

@ -323,7 +323,6 @@ function update_estimated_ram_use() {
var max_buffer_count = parseInt(document.querySelectorAll('input[name="newMonitor[MaxImageBufferCount]"]')[0].value);
if (max_buffer_count) {
var max_buffer_size = (min_buffer_count + max_buffer_count) * width * height * colours;
console.log(max_buffer_size);
document.getElementById('estimated_ram_use').innerHTML += ' Max: ' + human_filesize(max_buffer_size);
} else {
document.getElementById('estimated_ram_use').innerHTML += ' Max: Unlimited';
@ -345,4 +344,17 @@ function getLocation() {
}
}
function ManufacturerId_onchange(ManufacturerId_select) {
if (ManufacturerId_select.value())
$j('newMonitor[Manufacturer]').hide();
else
$j('newMonitor[Manufacturer]').show();
}
function ModelId_onchange(ModelId_select) {
if (ModelId_select.value())
$j('newMonitor[Model]').hide();
else
$j('newMonitor[Model]').show();
}
window.addEventListener('DOMContentLoaded', initPage);