Bug 22389: (bug 15836 follow-up) Add Delete regex links on creating splitting source
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 21 Feb 2019 16:42:30 +0000 (13:42 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 26 Feb 2019 09:19:55 +0000 (09:19 +0000)
The "Delete" link does not exist when the form is empty.

Test plan:
Create a new classification splitting source
Select "Regex" for routine
=> The delete link does not appear (you cannot remove if there is only
one input)
=> It a regex
=> The 2 delete links appear

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 63c5a813c994a4893eaef2cb87fcd26bc594c3e4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt

index 9f8a375..a023321 100644 (file)
                 [% ELSE %]
                     <div class="split_regex">
                         <input type="text" name="split_regex" id="split_regex" value="" />
+                        <a href="#" title="Delete" class="del_regex"><i class="fa fa-fw fa-trash"></i>Delete</a>
                     </div>
                 [% END %]
             </div>
 
         $(document).ready(function(){
             update_regex_block();
+            update_delete_links_visibility();
             $("#split_routine").on("change", function(){
                 update_regex_block();
             });