Martin Renvoize
30b23c5f1d
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
27 lines
915 B
JavaScript
27 lines
915 B
JavaScript
$(document).ready(function() {
|
|
$("#branch").on("change", function() {
|
|
var selectedBranch = $("#branch").children(
|
|
"option:selected").val();
|
|
|
|
$("#register_id").children().each(function() {
|
|
// default to no-register
|
|
if ($(this).is("#noregister")) {
|
|
$(this).prop("selected", true)
|
|
}
|
|
// display branch registers
|
|
else if ($(this).hasClass(selectedBranch)) {
|
|
$(this).prop("disabled", false);
|
|
$(this).show();
|
|
// default to branch default if there is one
|
|
if ($(this).hasClass("default")) {
|
|
$(this).prop("selected", true)
|
|
}
|
|
}
|
|
// hide non-branch registers
|
|
else {
|
|
$(this).hide();
|
|
$(this).prop("disabled", true);
|
|
}
|
|
});
|
|
});
|
|
});
|