Bug 32939: Have a generic APIClient object
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / js / staff-global.js
index ad62c34..c452e02 100644 (file)
@@ -49,15 +49,18 @@ $.fn.selectTabByID = function (tabID) {
 };
 
 $(document).ready(function() {
-    $('#header_search').tabs({
-        create: function( e, ui ){
-            ui.panel.find("input:text:first").focus();
-        },
-        activate: function ( e, ui ) {
-            ui.newPanel.find("input:text:first").focus();
-        }
-    });
-
+    //check for a hash before setting focus
+    let hash = window.location.hash;
+    if ( ! hash ) {
+        $('#header_search').tabs({
+            create: function( e, ui ){
+                ui.panel.find("input:text:first").focus();
+            },
+            activate: function ( e, ui ) {
+                ui.newPanel.find("input:text:first").focus();
+            }
+        });
+    }
     $(".close").click(function(){ window.close(); });
 
     $("#checkin_search form").preventDoubleFormSubmit();
@@ -69,6 +72,15 @@ $(document).ready(function() {
 
     $("#header_search > ul > li").show();
 
+    $('#header_search .form-extra-content-toggle').on('click', function () {
+        const extraContent = $(this).closest('form').find('.form-extra-content');
+        if (extraContent.is(':visible')) {
+            extraContent.hide();
+        } else {
+            extraContent.show();
+        }
+    });
+
     $(".focus").focus();
     $(".validated").each(function() {
         $(this).validate();
@@ -110,17 +122,16 @@ $(document).ready(function() {
         $("a[href$=\"/" + path + params + "\"]", navmenulist).addClass("current");
     }
 
-    $("#catalog-search-link a").on("hover", function(){
+    $("#catalog-search-link a").on("mouseenter mouseleave", function(){
         $("#catalog-search-dropdown a").toggleClass("catalog-search-dropdown-hover");
     });
 
     if ( localStorage.getItem("lastborrowernumber") ){
         if( $("#hiddenborrowernumber").val() != localStorage.getItem("lastborrowernumber") ) {
-            $("#lastborrower-window").detach().appendTo("#breadcrumbs");
             $("#lastborrowerlink").show();
             $("#lastborrowerlink").prop("title", localStorage.getItem("lastborrowername") + " (" + localStorage.getItem("lastborrowercard") + ")");
             $("#lastborrowerlink").prop("href", "/cgi-bin/koha/circ/circulation.pl?borrowernumber=" + localStorage.getItem("lastborrowernumber"));
-            $("#lastborrower-window").css("display", "inline-block");
+            $("#lastborrower-window").css("display", "inline-flex");
         }
     }