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 2898-2903 $star-selected: #EDB867; Link Here
2898
    margin-top: 30px;
2898
    margin-top: 30px;
2899
}
2899
}
2900
2900
2901
.sticky {
2902
    position: sticky;
2903
    top: -1px;
2904
    z-index: 999;
2905
}
2906
2901
.chocolat-wrapper {
2907
.chocolat-wrapper {
2902
    z-index: 1050;
2908
    z-index: 1050;
2903
2909
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt (-7 / +1 lines)
Lines 24-30 Link Here
24
                <div class="col">
24
                <div class="col">
25
                    <div id="userbasket" class="maincontent">
25
                    <div id="userbasket" class="maincontent">
26
                        <h1>Your cart</h1>
26
                        <h1>Your cart</h1>
27
                        <div id="floating">
27
                        <div id="floating" class="sticky">
28
                            <div id="toolbar" class="toolbar noprint">
28
                            <div id="toolbar" class="toolbar noprint">
29
                                [% IF ( verbose ) %]
29
                                [% IF ( verbose ) %]
30
                                    <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>
30
                                    <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 369-375 Link Here
369
[% INCLUDE 'opac-bottom.inc' %]
369
[% INCLUDE 'opac-bottom.inc' %]
370
370
371
[% BLOCK jsinclude %]
371
[% BLOCK jsinclude %]
372
    [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
373
        [% INCLUDE 'datatables.inc' %]
372
        [% INCLUDE 'datatables.inc' %]
374
        <script>
373
        <script>
375
            [% IF ( TagsInputEnabled && loggedinusername ) %]
374
            [% IF ( TagsInputEnabled && loggedinusername ) %]
Lines 527-537 Link Here
527
                });
526
                });
528
                enableCheckboxActions();
527
                enableCheckboxActions();
529
528
530
                Sticky = $("#floating");
531
                Sticky.hcSticky({
532
                    stickTo: "#userbasket",
533
                    stickyClass: "floating"
534
                });
535
            });
529
            });
536
530
537
            function enableCheckboxActions(){
531
            function enableCheckboxActions(){
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-2 / +1 lines)
Lines 176-182 Link Here
176
                                    [% END %]
176
                                    [% END %]
177
                                [% END # IF /searchdesc %]
177
                                [% END # IF /searchdesc %]
178
178
179
                                <div id="floating">
179
                                <div id="floating" class="sticky">
180
                                    <div id="toolbar" class="toolbar row align-items-center">
180
                                    <div id="toolbar" class="toolbar row align-items-center">
181
                                        <div id="top-pages" class="col">
181
                                        <div id="top-pages" class="col">
182
                                            [% INCLUDE 'page-numbers.inc' %]
182
                                            [% INCLUDE 'page-numbers.inc' %]
Lines 422-428 Link Here
422
    [% END %]
422
    [% END %]
423
    [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
423
    [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
424
    [% Asset.js("js/authtoresults.js") | $raw %]
424
    [% Asset.js("js/authtoresults.js") | $raw %]
425
    [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
426
    [% IF ( OpacHighlightedWords ) %]
425
    [% IF ( OpacHighlightedWords ) %]
427
        [% Asset.js("lib/jquery/plugins/jquery.highlight-5.js") | $raw %]
426
        [% Asset.js("lib/jquery/plugins/jquery.highlight-5.js") | $raw %]
428
    [% END %]
427
    [% 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 812-818 Link Here
812
812
813
[% INCLUDE 'opac-bottom.inc' %]
813
[% INCLUDE 'opac-bottom.inc' %]
814
[% BLOCK jsinclude %]
814
[% BLOCK jsinclude %]
815
[% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
816
[% IF OpenLibraryCovers || OpenLibrarySearch %]
815
[% IF OpenLibraryCovers || OpenLibrarySearch %]
817
    [% Asset.js("js/openlibrary.js") | $raw %]
816
    [% Asset.js("js/openlibrary.js") | $raw %]
818
[% END %]
817
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/global.js (-2 / +10 lines)
Lines 252-258 function setPlaceholder(){ Link Here
252
    $("#translControl1").attr("placeholder", search_placeholder );
252
    $("#translControl1").attr("placeholder", search_placeholder );
253
}
253
}
254
254
255
$(document).ready(function(){
255
$(document).ready(function () {
256
    //check if sticky element is stuck, if so add floating class
257
    if ( $('.sticky').length ) {
258
      const observer = new IntersectionObserver(
259
        ([e]) => e.target.classList.toggle('floating', e.intersectionRatio < 1),
260
        {threshold: [1]}
261
      );
262
263
      observer.observe(document.querySelector('.sticky'));
264
    }
256
    $("html").removeClass("no-js").addClass("js");
265
    $("html").removeClass("no-js").addClass("js");
257
    $(".close").click(function () {
266
    $(".close").click(function () {
258
        window.close();
267
        window.close();
259
- 

Return to bug 36694