From eb55af6d8660482db494e12215fe212c7c34dec7 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Sun, 24 Apr 2016 21:07:19 -0400 Subject: [PATCH] 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 Signed-off-by: Kyle M Hall --- .../prog/en/modules/virtualshelves/shelves.tt | 3 +++ .../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 805d3dde3e..2c8207d384 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 f19a54ac64..d8fa6f0fb5 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 ~%] -- 2.39.5