From 8648d6b9a85ea669eb965abc3e9c7a420d40623b Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Mon, 31 Oct 2022 12:16:27 -0400 Subject: [PATCH] Bug 24606: (QA follow-up) Disable 'Apply template' button if no template is selected Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js index 5d483f0030..ba2a40ef5f 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js @@ -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() { -- 2.30.2