Bug 26377: Show when loading the page if needed
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 31 May 2022 09:16:57 +0000 (11:16 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 20 Jul 2022 12:56:24 +0000 (09:56 -0300)
Prevent a blink

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
koha-tmpl/intranet-tmpl/prog/js/subscription-add.js

index e217e86..f8b9088 100644 (file)
@@ -199,7 +199,11 @@ fieldset.rows table { clear: none; margin: 0; }
                                         [% END %]
                                     </select>
                                 </li>
+                                [% IF serialsadditems %]
+                                <li class="use_items">
+                                [% ELSE %]
                                 <li class="use_items" style="display:none">
+                                [% END %]
                                     <label for="ccode">Collection:</label>
                                     <select name="ccode" id="ccode">
                                         <option value="">None</option>
@@ -212,7 +216,11 @@ fieldset.rows table { clear: none; margin: 0; }
                                         [% END %]
                                     </select>
                                 </li>
+                                [% IF serialsadditems %]
+                                <li class="use_items">
+                                [% ELSE %]
                                 <li class="use_items" style="display:none">
+                                [% END %]
                                     <label for="itemtype">Item type:</label>
                                     <select name="itemtype" id="itemtype">
                                         <option value=""></option>
index 3f6096d..df4ce94 100644 (file)
@@ -739,10 +739,6 @@ $(document).ready(function() {
         });
     });
 
-    if( $("#serialsadditems-yes").prop("checked") ){
-        $(".use_items").show();
-    }
-
     $("#serialsadditems-yes").on("change", function(){
         if( $(this).prop("checked") ){
             $(".use_items").show();