From 7e3162d789f38409c53694ca1818e6842180ff46 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Sun, 24 Apr 2016 21:07:19 -0400 Subject: [PATCH] [PASSED QA] Bug 16338 - Remove the use of "onclick" from the lists template This patch removes the use of "onclick" from the list delete button, moving the event definition into the script. Also changed: Removed some unnecessary link markup; Added some whitespace around the action buttons. To test, apply the patch and go to Lists. Click the "Delete" button next to any list. You should be prompted to confirm the deletion. Verify that both confirming and canceling the deletion works correctly. Signed-off-by: Aleisha Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt | 3 +++ .../prog/en/modules/virtualshelves/tables/shelves_results.tt | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index 7383f0d..47df3e3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -107,6 +107,9 @@ $(document).ready(function(){ } } }); + $("body").on("click", ".deleteshelf", function(){ + return confirmDelete(MSG_CONFIRM_DELETE_LIST); + }); }); [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt index f19a54a..d8fa6f0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt @@ -22,7 +22,7 @@ "dt_modification_time": "[% data.modification_time | $KohaDates %]", "dt_action": - "[% PROCESS action_form shelfnumber=data.shelfnumber can_manage_shelf=data.can_manage_shelf can_delete_shelf=data.can_delete_shelf type=data.type %]" + "[% PROCESS action_form shelfnumber=data.shelfnumber can_manage_shelf=data.can_manage_shelf can_delete_shelf=data.can_delete_shelf type=data.type %]" }[% UNLESS loop.last %],[% END %] [% END %] ] @@ -38,17 +38,17 @@ [%~ action_block = action_block _ '' ~%] [%~ action_block = action_block _ '' ~%] [%~ action_block = action_block _ '' ~%] - [%~ action_block = action_block _ '' ~%] + [%~ action_block = action_block _ ' ' ~%] [%~ END ~%] [%~ IF can_manage_shelf OR can_delete_shelf ~%] - [%~ action_block = action_block _ '
' ~%] + [%~ action_block = action_block _ ' ' ~%] [%~ action_block = action_block _ '' ~%] [%~ action_block = action_block _ '' ~%] [%~ action_block = action_block _ '' ~%] [%~ action_block = action_block _ '' ~%] [%~ action_block = action_block _ '' ~%] [%~ action_block = action_block _ '' ~%] - [%~ action_block = action_block _ '' ~%] + [%~ action_block = action_block _ '' ~%] [%~ action_block = action_block _ '
' ~%] [%~ END ~%] [%~ ELSE ~%] -- 1.9.1