View | Details | Raw Unified | Return to bug 36694
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (-1 / +1 lines)
Lines 61-67 $.fn.selectTabByID = function (tabID) { Link Here
61
61
62
$(document).ready(function () {
62
$(document).ready(function () {
63
    //check if sticky element is stuck, if so add floating class
63
    //check if sticky element is stuck, if so add floating class
64
    if ( $('#toolbar.sticky').length ) {
64
    if ( $('.sticky').length ) {
65
      const observer = new IntersectionObserver(
65
      const observer = new IntersectionObserver(
66
        ([e]) => e.target.classList.toggle('floating', e.intersectionRatio < 1),
66
        ([e]) => e.target.classList.toggle('floating', e.intersectionRatio < 1),
67
        {threshold: [1]}
67
        {threshold: [1]}
(-)a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss (+6 lines)
Lines 2946-2951 $star-selected: #EDB867; Link Here
2946
    font-size: 1.1rem;
2946
    font-size: 1.1rem;
2947
}
2947
}
2948
2948
2949
.sticky {
2950
    position: sticky;
2951
    top: -1px;
2952
    z-index: 999;
2953
}
2954
2949
.chocolat-wrapper {
2955
.chocolat-wrapper {
2950
    z-index: 1050;
2956
    z-index: 1050;
2951
2957
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt (-7 / +1 lines)
Lines 19-25 Link Here
19
                <div class="col">
19
                <div class="col">
20
                    <div id="userbasket" class="maincontent">
20
                    <div id="userbasket" class="maincontent">
21
                        <h1>Your cart</h1>
21
                        <h1>Your cart</h1>
22
                        <div id="floating">
22
                        <div id="floating" class="sticky">
23
                            <div id="toolbar" class="toolbar noprint">
23
                            <div id="toolbar" class="toolbar noprint">
24
                                [% IF ( verbose ) %]
24
                                [% IF ( verbose ) %]
25
                                    <a href="opac-basket.pl" class="btn btn-link btn-sm brief"><i class="fa fa-fw fa-search-minus" aria-hidden="true"></i> Brief display</a>
25
                                    <a href="opac-basket.pl" class="btn btn-link btn-sm brief"><i class="fa fa-fw fa-search-minus" aria-hidden="true"></i> Brief display</a>
Lines 363-369 Link Here
363
[% INCLUDE 'opac-bottom.inc' %]
363
[% INCLUDE 'opac-bottom.inc' %]
364
364
365
[% BLOCK jsinclude %]
365
[% BLOCK jsinclude %]
366
    [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
367
        [% INCLUDE 'datatables.inc' %]
366
        [% INCLUDE 'datatables.inc' %]
368
        <script>
367
        <script>
369
            [% IF ( TagsInputEnabled && loggedinusername ) %]
368
            [% IF ( TagsInputEnabled && loggedinusername ) %]
Lines 521-531 Link Here
521
                });
520
                });
522
                enableCheckboxActions();
521
                enableCheckboxActions();
523
522
524
                Sticky = $("#floating");
525
                Sticky.hcSticky({
526
                    stickTo: "#userbasket",
527
                    stickyClass: "floating"
528
                });
529
            });
523
            });
530
524
531
            function enableCheckboxActions(){
525
            function enableCheckboxActions(){
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-8 / +1 lines)
Lines 155-161 Link Here
155
                                    [% END %]
155
                                    [% END %]
156
                                [% END # IF /searchdesc %]
156
                                [% END # IF /searchdesc %]
157
157
158
                                <div id="floating">
158
                                <div id="floating" class="sticky">
159
                                    <div id="toolbar" class="toolbar row align-items-center">
159
                                    <div id="toolbar" class="toolbar row align-items-center">
160
                                        <div id="top-pages" class="col">
160
                                        <div id="top-pages" class="col">
161
                                            [% INCLUDE 'page-numbers.inc' %]
161
                                            [% INCLUDE 'page-numbers.inc' %]
Lines 571-577 Link Here
571
    [% END %]
571
    [% END %]
572
    [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
572
    [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
573
    [% Asset.js("js/authtoresults.js") | $raw %]
573
    [% Asset.js("js/authtoresults.js") | $raw %]
574
    [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
575
    [% IF ( OpacHighlightedWords ) %]
574
    [% IF ( OpacHighlightedWords ) %]
576
        [% Asset.js("lib/jquery/plugins/jquery.highlight-5.js") | $raw %]
575
        [% Asset.js("lib/jquery/plugins/jquery.highlight-5.js") | $raw %]
577
    [% END %]
576
    [% END %]
Lines 903-914 Link Here
903
                if (e.keyCode == 13) { e.preventDefault(); }
902
                if (e.keyCode == 13) { e.preventDefault(); }
904
            });
903
            });
905
904
906
            Sticky = $("#floating");
907
            Sticky.hcSticky({
908
                stickTo: ".searchresults",
909
                stickyClass: "floating"
910
            });
911
912
        });
905
        });
913
    </script>
906
    </script>
914
[% END %]
907
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-8 / +1 lines)
Lines 219-225 Link Here
219
                        [% IF ( itemsloop ) %]
219
                        [% IF ( itemsloop ) %]
220
                            [% SET contents = shelf.get_contents %]
220
                            [% SET contents = shelf.get_contents %]
221
                            [% IF ( contents.count ) %]<p>This list contains [% contents.count | html %] titles</p>[% END %]
221
                            [% IF ( contents.count ) %]<p>This list contains [% contents.count | html %] titles</p>[% END %]
222
                            <div id="floating">
222
                            <div id="floating" class="sticky">
223
                                <div id="toolbar" class="toolbar clearfix">
223
                                <div id="toolbar" class="toolbar clearfix">
224
                                    <div class="list-actions">
224
                                    <div class="list-actions">
225
                                        <a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-fw fa-plus" aria-hidden="true"></i> New list</a> <span class="sep">|</span>
225
                                        <a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-fw fa-plus" aria-hidden="true"></i> New list</a> <span class="sep">|</span>
Lines 832-838 Link Here
832
832
833
[% INCLUDE 'opac-bottom.inc' %]
833
[% INCLUDE 'opac-bottom.inc' %]
834
[% BLOCK jsinclude %]
834
[% BLOCK jsinclude %]
835
[% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
836
[% IF OpenLibraryCovers || OpenLibrarySearch %]
835
[% IF OpenLibraryCovers || OpenLibrarySearch %]
837
    [% Asset.js("js/openlibrary.js") | $raw %]
836
    [% Asset.js("js/openlibrary.js") | $raw %]
838
[% END %]
837
[% END %]
Lines 1052-1063 $(function() { Link Here
1052
1051
1053
    AdjustRemark();
1052
    AdjustRemark();
1054
1053
1055
    Sticky = $("#floating");
1056
    Sticky.hcSticky({
1057
        stickTo: "#usershelves",
1058
        stickyClass: "floating"
1059
    });
1060
1061
    [% IF itemsloop %]
1054
    [% IF itemsloop %]
1062
        sortMenu( $("#sorting-form") );
1055
        sortMenu( $("#sorting-form") );
1063
1056
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/global.js (-1 / +9 lines)
Lines 212-217 var facetHandler = function(e){ Link Here
212
};
212
};
213
213
214
$(document).ready(function(){
214
$(document).ready(function(){
215
    //check if sticky element is stuck, if so add floating class
216
    if ( $('.sticky').length ) {
217
      const observer = new IntersectionObserver(
218
        ([e]) => e.target.classList.toggle('floating', e.intersectionRatio < 1),
219
        {threshold: [1]}
220
      );
221
222
      observer.observe(document.querySelector('.sticky'));
223
    }
215
    $("html").removeClass("no-js").addClass("js");
224
    $("html").removeClass("no-js").addClass("js");
216
    $(".close").click(function(){
225
    $(".close").click(function(){
217
        window.close();
226
        window.close();
218
- 

Return to bug 36694