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 2980-2985 $star-selected: #EDB867; Link Here
2980
    margin-top: 30px;
2980
    margin-top: 30px;
2981
}
2981
}
2982
2982
2983
.sticky {
2984
    position: sticky;
2985
    top: -1px;
2986
    z-index: 999;
2987
}
2988
2983
.chocolat-wrapper {
2989
.chocolat-wrapper {
2984
    z-index: 1050;
2990
    z-index: 1050;
2985
2991
(-)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 364-370 Link Here
364
[% INCLUDE 'opac-bottom.inc' %]
364
[% INCLUDE 'opac-bottom.inc' %]
365
365
366
[% BLOCK jsinclude %]
366
[% BLOCK jsinclude %]
367
    [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
368
        [% INCLUDE 'datatables.inc' %]
367
        [% INCLUDE 'datatables.inc' %]
369
        <script>
368
        <script>
370
            [% IF ( TagsInputEnabled && loggedinusername ) %]
369
            [% IF ( TagsInputEnabled && loggedinusername ) %]
Lines 522-532 Link Here
522
                });
521
                });
523
                enableCheckboxActions();
522
                enableCheckboxActions();
524
523
525
                Sticky = $("#floating");
526
                Sticky.hcSticky({
527
                    stickTo: "#userbasket",
528
                    stickyClass: "floating"
529
                });
530
            });
524
            });
531
525
532
            function enableCheckboxActions(){
526
            function enableCheckboxActions(){
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-8 / +1 lines)
Lines 156-162 Link Here
156
                                    [% END %]
156
                                    [% END %]
157
                                [% END # IF /searchdesc %]
157
                                [% END # IF /searchdesc %]
158
158
159
                                <div id="floating">
159
                                <div id="floating" class="sticky">
160
                                    <div id="toolbar" class="toolbar row align-items-center">
160
                                    <div id="toolbar" class="toolbar row align-items-center">
161
                                        <div id="top-pages" class="col">
161
                                        <div id="top-pages" class="col">
162
                                            [% INCLUDE 'page-numbers.inc' %]
162
                                            [% INCLUDE 'page-numbers.inc' %]
Lines 572-578 Link Here
572
    [% END %]
572
    [% END %]
573
    [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
573
    [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
574
    [% Asset.js("js/authtoresults.js") | $raw %]
574
    [% Asset.js("js/authtoresults.js") | $raw %]
575
    [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
576
    [% IF ( OpacHighlightedWords ) %]
575
    [% IF ( OpacHighlightedWords ) %]
577
        [% Asset.js("lib/jquery/plugins/jquery.highlight-5.js") | $raw %]
576
        [% Asset.js("lib/jquery/plugins/jquery.highlight-5.js") | $raw %]
578
    [% END %]
577
    [% END %]
Lines 904-915 Link Here
904
                if (e.keyCode == 13) { e.preventDefault(); }
903
                if (e.keyCode == 13) { e.preventDefault(); }
905
            });
904
            });
906
905
907
            Sticky = $("#floating");
908
            Sticky.hcSticky({
909
                stickTo: ".searchresults",
910
                stickyClass: "floating"
911
            });
912
913
        });
906
        });
914
    </script>
907
    </script>
915
[% END %]
908
[% 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 1048-1059 $(function() { Link Here
1048
1047
1049
    AdjustRemark();
1048
    AdjustRemark();
1050
1049
1051
    Sticky = $("#floating");
1052
    Sticky.hcSticky({
1053
        stickTo: "#usershelves",
1054
        stickyClass: "floating"
1055
    });
1056
1057
    [% IF itemsloop %]
1050
    [% IF itemsloop %]
1058
        sortMenu( $("#sorting-form") );
1051
        sortMenu( $("#sorting-form") );
1059
1052
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/global.js (-1 / +9 lines)
Lines 250-255 var facetHandler = function (e) { Link Here
250
};
250
};
251
251
252
$(document).ready(function () {
252
$(document).ready(function () {
253
    //check if sticky element is stuck, if so add floating class
254
    if ( $('.sticky').length ) {
255
      const observer = new IntersectionObserver(
256
        ([e]) => e.target.classList.toggle('floating', e.intersectionRatio < 1),
257
        {threshold: [1]}
258
      );
259
260
      observer.observe(document.querySelector('.sticky'));
261
    }
253
    $("html").removeClass("no-js").addClass("js");
262
    $("html").removeClass("no-js").addClass("js");
254
    $(".close").click(function () {
263
    $(".close").click(function () {
255
        window.close();
264
        window.close();
256
- 

Return to bug 36694