Bug 24606: (QA follow-up) Disable 'Apply template' button if no template is selected

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Kyle Hall 2022-10-31 12:16:27 -04:00 committed by Tomas Cohen Arazi
parent 02dd772290
commit 1e0fe4af21
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -88,11 +88,19 @@ $(document).ready(function(){
});
$("#template_id").on("change", function() {
if ( $(this).find(":selected").data("editor") ) {
let option = $(this).find(":selected");
if ( option.data("editor") ) {
$("#delete_template_submit").removeAttr("disabled");
} else {
$("#delete_template_submit").attr("disabled", "disabled");
}
if ( option.val() != 0 ) {
$("#load_template_submit").removeAttr("disabled");
} else {
$("#load_template_submit").attr("disabled", "disabled");
}
});
$("#template_id").change(); // Trigger to enable delete button if patron's template is in use
$("#replace_template_id").on("change", function() {