From 19e411fdcec1b4ffe29a0166fbb10fecc2f0cb7e Mon Sep 17 00:00:00 2001
From: Lucas Gass <lucas@bywatersolutions.com>
Date: Thu, 25 Apr 2024 19:58:59 +0000
Subject: [PATCH] Bug 36694: Remove HC sticky from catalogue/ pages

---
 .../prog/en/modules/catalogue/advsearch.tt          | 13 +++----------
 .../prog/en/modules/catalogue/itemsearch.tt         |  8 +-------
 .../prog/en/modules/catalogue/results.tt            |  2 +-
 koha-tmpl/intranet-tmpl/prog/js/pages/results.js    |  7 -------
 4 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt
index 0d0ec4ce3f..2d981998f3 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt
@@ -81,7 +81,7 @@
                         <h1>Advanced search</h1>
 
                         <!-- SEARCH BUTTONS -->
-                        <div id="toolbar" class="btn-toolbar">
+                        <div id="toolbar" class="btn-toolbar sticky">
                             <div class="btn-group">
                                 <button class="btn btn-primary" type="submit" accesskey="s"><i class="fa fa-search"></i> Search</button>
                             </div>
@@ -101,7 +101,7 @@
                             </div>
 
                             [% IF Koha.Preference('EnableSearchHistory') %]
-                                <div class="btn-group">
+                            <div class="btn-group">
                                 <a href="/cgi-bin/koha/catalogue/search-history.pl" class="btn btn-link"><i class="fa fa-history"></i> Search history</a>
                             </div>
                             [% END %]
@@ -209,7 +209,6 @@
                     [% END %]
                     </fieldset>
                 <!-- /BOOLEAN SEARCH OPTIONS -->
-                </div> <!-- /#advanced-search -->
 
                 <!-- MC-TYPE LIMITS -->
                 [% WRAPPER tabs id= "advsearches" %]
@@ -401,12 +400,12 @@
                     </p>
                 </fieldset> <!-- /#sortby -->
                 <!-- /RANK LIMITS -->
+                </div> <!-- /#advanced-search -->
             </form>
         </div>
     </div>
 
 [% MACRO jsinclude BLOCK %]
-    [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
     [% Asset.js("js/browser.js") | $raw %]
     [% Asset.css("css/humanmsg.css") | $raw %]
     [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
@@ -423,17 +422,11 @@
             line.removeChild(ButtonPlus);
         }
 
-        var Sticky;
         $(document).ready(function() {
             $("input[name=q]:eq(0)").focus();
             if( $("#advsearches .tab-pane.active").length < 1 ){
                 $("#advsearches a:first").tab("show");
             }
-            Sticky = $("#toolbar");
-            Sticky.hcSticky({
-                stickTo: ".main",
-                stickyClass: "floating"
-            });
             [% IF search_groups %]
                 function branch_limit() {
                     if( $("#branchloop").val() != "" ){
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
index b9b71ae634..97e9633b92 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
@@ -176,7 +176,7 @@
       <h1>Item search</h1>
 
       <form action="/cgi-bin/koha/catalogue/itemsearch.pl" method="get" id="itemsearchform">
-          <div id="toolbar" class="btn-toolbar">
+          <div id="toolbar" class="btn-toolbar sticky">
                 <div class="btn-group">
                     <button class="btn btn-primary"><i class="fa fa-search"></i> Search</button>
                 </div>
@@ -287,7 +287,6 @@
 [% MACRO jsinclude BLOCK %]
     [% INCLUDE 'datatables.inc' %]
     [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
-    [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
     <script>
         var authorised_values = [% authorised_values_json | $raw %];
 
@@ -574,11 +573,6 @@
             });
             $('#results').on('draw.dt', function (e, settings) {
                 prepSelections();
-                var Sticky = $("#searchheader");
-                Sticky.hcSticky({
-                    stickTo: "#results-wrapper .page-section",
-                    stickyClass: "floating"
-                });
             });
         }
 
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
index e09aeeb072..637f091e47 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
@@ -102,7 +102,7 @@
                         </form>
                     </div>
 
-                    <div class="searchheader" id="searchheader">
+                    <div class="searchheader sticky" id="searchheader">
                         <div id="selection_ops">
                             <a href="#" class="btn btn-link" id="select_all"><i class="fa fa-check"></i> Select all</a>
                             <a href="#" class="btn btn-link" id="clear_all"><i class="fa fa-times"></i> Clear all</a>
diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js b/koha-tmpl/intranet-tmpl/prog/js/pages/results.js
index 283044d2ae..366953c563 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js
+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/results.js
@@ -104,7 +104,6 @@ $(window).load(function() {
     verify_cover_images();
 });
 
-var Sticky;
 var toHighlight = {};
 var q_array;
 
@@ -130,12 +129,6 @@ $(document).ready(function() {
         $(this).toggle();
     });
 
-    Sticky = $("#searchheader");
-    Sticky.hcSticky({
-        stickTo: "main",
-        stickyClass: "floating"
-    });
-
     $("#cartsubmit").click(function(e){
         e.preventDefault();
         addMultiple();
-- 
2.30.2