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 <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Owen Leonard 2016-06-14 10:26:25 -04:00 committed by Kyle M Hall
parent 2d15bc5355
commit fe32cc2a30
2 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@
<td class="actions">
<a class="btn btn-mini" href="/cgi-bin/koha/tools/marc_modification_templates.pl?template_id=[% TemplatesLoo.template_id %]&amp;op=select_template" ><i class="fa fa-fw fa-pencil"></i> Edit actions</a>
<a class="btn btn-mini duplicate_template" href="#" data-toggle="modal" data-template_id="[% TemplatesLoo.template_id %]" data-target="#createTemplate"><i class="fa fa-fw fa-copy"></i> Duplicate</a>
<a class="btn btn-mini" href="/cgi-bin/koha/tools/marc_modification_templates.pl?template_id=[% TemplatesLoo.template_id %]&amp;op=delete_template" class="delete_template" onclick="return confirmDeleteAction();"><i class="fa fa-fw fa-trash"></i> Delete</a>
<a class="btn btn-mini delete_template" href="/cgi-bin/koha/tools/marc_modification_templates.pl?template_id=[% TemplatesLoo.template_id %]&amp;op=delete_template" onclick="return confirmDeleteAction();"><i class="fa fa-fw fa-trash"></i> Delete</a>
</td>
</tr>
[% END %]

View File

@ -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);