Bug 11565 [QA Followup] - Only hide options when none are in use
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 27 Apr 2016 15:39:55 +0000 (15:39 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 12:11:49 +0000 (12:11 +0000)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js

index 92dba4b..3a35fba 100644 (file)
@@ -49,6 +49,15 @@ $(document).ready(function() {
     var checkout_settings = $(".checkout-settings");
     var checkout_settings_icon = $(".checkout-settings-icon");
 
+    // If any checkboxes in the checkout settings are selected, show the settings by default
+    if ( $(".checkout-settings input:checked,#duedatespec[value!='']").length ) {
+        checkout_settings.show();
+        checkout_settings_icon.removeClass("fa-caret-right").addClass("fa-caret-down");
+    } else {
+        checkout_settings.hide();
+        checkout_settings_icon.removeClass("fa-caret-down").addClass("fa-caret-right");
+    }
+
     $("#show-checkout-settings a").on("click",function(){
         if( checkout_settings.is(":hidden")){
             checkout_settings.show();