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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt (-21 lines)
Lines 178-204 Link Here
178
        $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
178
        $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
179
    }
179
    }
180
180
181
    /**
182
    * Returns a roughly ideal position to scroll an element into view
183
    * @param {string} target - The HTML id of the element to scroll into view
184
    * @param {string} elemid - The HTML id of the element which might obscure
185
    *                          the view of the target element e.g. a floating toolbar
186
    * @return {number} - The y-coordinate to pass to window.scrollTo()
187
    */
188
    function getScrollto( target, elemid ){
189
        var dest = $("#" + target );
190
        var yoffset = dest.offset();
191
192
        if( elemid != "" ){
193
            var element = $("#" + elemid );
194
            var elem_height = element.outerHeight();
195
        } else {
196
            elem_height = 0;
197
        }
198
        return yoffset.top - elem_height - 20;
199
    }
200
201
202
    /**
181
    /**
203
    * check if z3950 mandatories are set or not
182
    * check if z3950 mandatories are set or not
204
    */
183
    */
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-9 / +50 lines)
Lines 15-25 Link Here
15
    [% END %]</title
15
    [% END %]</title
16
>
16
>
17
[% INCLUDE 'doc-head-close.inc' %]
17
[% INCLUDE 'doc-head-close.inc' %]
18
<style>
18
[% FILTER collapse %]
19
    .listgroup .rows {
19
    <style>
20
        margin-left: 1em;
20
        .listgroup .rows {
21
    }
21
            margin-left: 1em;
22
</style>
22
        }
23
        h3 {
24
            background-color: #fff;
25
            border: 1px solid #fff;
26
            margin-bottom: 0;
27
            padding: 1rem;
28
        }
29
        h3:hover {
30
            border: 1px solid #6faf44;
31
            cursor: pointer;
32
        }
33
        h3 i {
34
            color: #4c7aa8;
35
            font-size: 80%;
36
            padding-right: 0.2rem;
37
        }
38
        h3.collapsed i.fa.fa-caret-down::before {
39
            content: "\f0da";
40
        }
41
    </style>
42
[% END %]
23
</head>
43
</head>
24
<body id="catalog_moredetail" class="catalog">
44
<body id="catalog_moredetail" class="catalog">
25
[% USE KohaDates %]
45
[% USE KohaDates %]
Lines 112-117 Link Here
112
        [% END %]
132
        [% END %]
113
133
114
        [% FOREACH ITEM_DAT IN ITEM_DATA %]
134
        [% FOREACH ITEM_DAT IN ITEM_DATA %]
135
            <h3 id="item[% ITEM_DAT.itemnumber | html %]" class="expanded">
136
                <i class="fa fa-caret-down" title="Collapse this section"></i>
137
                Barcode [% ITEM_DAT.barcode | html %] [% IF not_for_loan %][% not_for_loan_description | html %][% END %]
138
            </h3>
115
            <div class="page-section clearfix">
139
            <div class="page-section clearfix">
116
                [% SET not_for_loan = 0 %]
140
                [% SET not_for_loan = 0 %]
117
                [% IF ITEM_DAT.notforloan || ITEM_DAT.effective_itemtype.notforloan %]
141
                [% IF ITEM_DAT.notforloan || ITEM_DAT.effective_itemtype.notforloan %]
Lines 119-126 Link Here
119
                    [% SET not_for_loan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
143
                    [% SET not_for_loan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
120
                [% END %]
144
                [% END %]
121
                <div class="listgroup">
145
                <div class="listgroup">
122
                    <h3 id="item[% ITEM_DAT.itemnumber | html %]"> Barcode [% ITEM_DAT.barcode | html %] [% IF not_for_loan %][% not_for_loan_description | html %][% END %] </h3>
123
124
                    <h4>
146
                    <h4>
125
                        Item information
147
                        Item information
126
                        [% UNLESS ( ITEM_DAT.nomod ) %]
148
                        [% UNLESS ( ITEM_DAT.nomod ) %]
Lines 553-560 Link Here
553
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
575
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
554
    [% END %]
576
    [% END %]
555
    <script>
577
    <script>
556
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
578
        $(document).ready(function(){
557
        browser.show();
579
            var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
580
            browser.show();
581
            $(".collapsed, .expanded").on("click",function(e){
582
                e.preventDefault();
583
                var linkid = this.id;
584
                window.scrollTo( 0, getScrollto( linkid, "" ) );
585
                togglePanel( $(this) );
586
            });
587
        });
588
589
        function togglePanel( node ){
590
            var panel = node.next( ".page-section" );
591
            if(panel.is(":visible")){
592
                node.addClass("collapsed").removeClass("expanded").attr("title", __("Click to expand this section") );
593
                panel.hide();
594
            } else {
595
                node.addClass("expanded").removeClass("collapsed").attr("title", __("Click to collapse this section") );
596
                panel.show();
597
            }
598
        }
558
    </script>
599
    </script>
559
[% END %]
600
[% END %]
560
[% INCLUDE 'intranet-bottom.inc' %]
601
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-20 lines)
Lines 212-237 Link Here
212
            $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
212
            $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
213
        }
213
        }
214
214
215
        /**
216
        * Returns a roughly ideal position to scroll an element into view
217
        * @param {string} target - The HTML id of the element to scroll into view
218
        * @param {string} elemid - The HTML id of the element which might obscure
219
        *                          the view of the target element e.g. a floating toolbar
220
        * @return {number} - The y-coordinate to pass to window.scrollTo()
221
        */
222
        function getScrollto( target, elemid ){
223
            var dest = $("#" + target );
224
            var yoffset = dest.offset();
225
226
            if( elemid != "" ){
227
                var element = $("#" + elemid );
228
                var elem_height = element.outerHeight();
229
            } else {
230
                elem_height = 0;
231
            }
232
            return yoffset.top - elem_height - 20;
233
        }
234
235
        function redirect(dest){
215
        function redirect(dest){
236
            $("#redirect").attr("value",dest);
216
            $("#redirect").attr("value",dest);
237
            return Check();
217
            return Check();
(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (-1 / +20 lines)
Lines 966-968 function toggleBtnIcon(element, start, replacement) { Link Here
966
            });
966
            });
967
    });
967
    });
968
}
968
}
969
- 
969
970
/**
971
 * Returns a roughly ideal position to scroll an element into view
972
 * @param {string} target - The HTML id of the element to scroll into view
973
 * @param {string} elemid - The HTML id of the element which might obscure
974
 *                          the view of the target element e.g. a floating toolbar
975
 * @return {number} - The y-coordinate to pass to window.scrollTo()
976
 */
977
function getScrollto(target, elemid) {
978
    var dest = $("#" + target);
979
    var yoffset = dest.offset();
980
981
    if (elemid != "") {
982
        var element = $("#" + elemid);
983
        var elem_height = element.outerHeight();
984
    } else {
985
        elem_height = 0;
986
    }
987
    return yoffset.top - elem_height - 20;
988
}

Return to bug 7508