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 2993-2998 $star-selected: #EDB867; Link Here
2993
    margin-top: 30px;
2993
    margin-top: 30px;
2994
}
2994
}
2995
2995
2996
.sticky {
2997
    position: sticky;
2998
    top: -1px;
2999
    z-index: 999;
3000
}
3001
2996
.chocolat-wrapper {
3002
.chocolat-wrapper {
2997
    z-index: 1050;
3003
    z-index: 1050;
2998
3004
(-)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 (-2 / +1 lines)
Lines 164-170 Link Here
164
                                    [% END %]
164
                                    [% END %]
165
                                [% END # IF /searchdesc %]
165
                                [% END # IF /searchdesc %]
166
166
167
                                <div id="floating">
167
                                <div id="floating" class="sticky">
168
                                    <div id="toolbar" class="toolbar row align-items-center">
168
                                    <div id="toolbar" class="toolbar row align-items-center">
169
                                        <div id="top-pages" class="col">
169
                                        <div id="top-pages" class="col">
170
                                            [% INCLUDE 'page-numbers.inc' %]
170
                                            [% INCLUDE 'page-numbers.inc' %]
Lines 492-498 Link Here
492
    [% END %]
492
    [% END %]
493
    [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
493
    [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
494
    [% Asset.js("js/authtoresults.js") | $raw %]
494
    [% Asset.js("js/authtoresults.js") | $raw %]
495
    [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
496
    [% IF ( OpacHighlightedWords ) %]
495
    [% IF ( OpacHighlightedWords ) %]
497
        [% Asset.js("lib/jquery/plugins/jquery.highlight-5.js") | $raw %]
496
        [% Asset.js("lib/jquery/plugins/jquery.highlight-5.js") | $raw %]
498
    [% END %]
497
    [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-2 / +1 lines)
Lines 228-234 Link Here
228
                        [% IF ( itemsloop ) %]
228
                        [% IF ( itemsloop ) %]
229
                            [% SET contents = shelf.get_contents %]
229
                            [% SET contents = shelf.get_contents %]
230
                            [% IF ( contents.count ) %]<p>This list contains [% contents.count | html %] titles</p>[% END %]
230
                            [% IF ( contents.count ) %]<p>This list contains [% contents.count | html %] titles</p>[% END %]
231
                            <div id="floating">
231
                            <div id="floating" class="sticky">
232
                                <div id="toolbar" class="toolbar clearfix">
232
                                <div id="toolbar" class="toolbar clearfix">
233
                                    <div class="list-actions">
233
                                    <div class="list-actions">
234
                                        <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>
234
                                        <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 813-819 Link Here
813
813
814
[% INCLUDE 'opac-bottom.inc' %]
814
[% INCLUDE 'opac-bottom.inc' %]
815
[% BLOCK jsinclude %]
815
[% BLOCK jsinclude %]
816
[% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
817
[% IF OpenLibraryCovers || OpenLibrarySearch %]
816
[% IF OpenLibraryCovers || OpenLibrarySearch %]
818
    [% Asset.js("js/openlibrary.js") | $raw %]
817
    [% Asset.js("js/openlibrary.js") | $raw %]
819
[% END %]
818
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/global.js (-2 / +10 lines)
Lines 254-260 function setPlaceholder(){ Link Here
254
    $("#translControl1").attr("placeholder", search_placeholder );
254
    $("#translControl1").attr("placeholder", search_placeholder );
255
}
255
}
256
256
257
$(document).ready(function(){
257
$(document).ready(function () {
258
    //check if sticky element is stuck, if so add floating class
259
    if ( $('.sticky').length ) {
260
      const observer = new IntersectionObserver(
261
        ([e]) => e.target.classList.toggle('floating', e.intersectionRatio < 1),
262
        {threshold: [1]}
263
      );
264
265
      observer.observe(document.querySelector('.sticky'));
266
    }
258
    $("html").removeClass("no-js").addClass("js");
267
    $("html").removeClass("no-js").addClass("js");
259
    $(".close").click(function () {
268
    $(".close").click(function () {
260
        window.close();
269
        window.close();
261
- 

Return to bug 36694