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)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 21 Feb 2019 17:04:42 +0000 (17:04 +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>
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();
             });