From 861526050ffd599d33cb7bfd43bc14235b9fe932 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 Content-Type: text/plain; charset="utf-8" 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. --- .../prog/en/modules/tools/marc_modification_templates.tt | 2 +- koha-tmpl/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 082c77e..7c5159e 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 31ea7f7..80f74f3 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.1.4