From fe32cc2a309b39930c42c9be73f372a80aac54ba Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 14 Jun 2016 10:26:25 -0400 Subject: [PATCH] Bug 16148 [Follow-up] Revised layout and behavior of marc modification template management This follow-up corrects a JavaScript error by using jQuery, which is is more forgiving when selecting elements which may not exist on the page. Also changed: Corrected a duplicate class attribute and fixed a jshint error. Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- .../prog/en/modules/tools/marc_modification_templates.tt | 2 +- .../intranet-tmpl/prog/js/marc_modification_templates.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt index 082c77e88d..7c5159e3b3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt @@ -84,7 +84,7 @@ Edit actions Duplicate - Delete + Delete [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js b/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js index 31ea7f72ac..80f74f3ddc 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js +++ b/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js @@ -1,6 +1,6 @@ $(document).ready(function() { - window.modaction_legend_innerhtml = document.getElementById('modaction_legend').innerHTML; - window.action_submit_value = document.getElementById('action_submit').value; + window.modaction_legend_innerhtml = $("#modaction_legend").text(); + window.action_submit_value = $("#action_submit").text(); $('#select_template').find("input:submit").hide(); $('#select_template').change(function() { @@ -68,7 +68,7 @@ $(document).ready(function() { $("#duplicate_a_template").on("change",function(e){ e.preventDefault(); - if( this.value == '' ){ + if( this.value === '' ){ $("#duplicate_current_template").val(""); } else { $("#duplicate_current_template").val(1); -- 2.39.5