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 186-212 Link Here
186
        $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
186
        $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
187
    }
187
    }
188
188
189
    /**
190
    * Returns a roughly ideal position to scroll an element into view
191
    * @param {string} target - The HTML id of the element to scroll into view
192
    * @param {string} elemid - The HTML id of the element which might obscure
193
    *                          the view of the target element e.g. a floating toolbar
194
    * @return {number} - The y-coordinate to pass to window.scrollTo()
195
    */
196
    function getScrollto( target, elemid ){
197
        var dest = $("#" + target );
198
        var yoffset = dest.offset();
199
200
        if( elemid != "" ){
201
            var element = $("#" + elemid );
202
            var elem_height = element.outerHeight();
203
        } else {
204
            elem_height = 0;
205
        }
206
        return yoffset.top - elem_height - 20;
207
    }
208
209
210
    /**
189
    /**
211
    * check if z3950 mandatories are set or not
190
    * check if z3950 mandatories are set or not
212
    */
191
    */
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-6 / +50 lines)
Lines 15-21 Link Here
15
    [% t("Koha") | html %]
15
    [% t("Koha") | html %]
16
[% END %]</title>
16
[% END %]</title>
17
[% INCLUDE 'doc-head-close.inc' %]
17
[% INCLUDE 'doc-head-close.inc' %]
18
<style>.listgroup .rows{margin-left:1em;}</style>
18
[% FILTER collapse %]
19
    <style>
20
        .listgroup .rows{
21
            margin-left: 1em;
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: .2rem;
37
        }
38
        h3.collapsed i.fa.fa-caret-down::before {
39
           content: "\f0da";
40
        }
41
    </style>
42
[% END %]
19
</head>
43
</head>
20
<body id="catalog_moredetail" class="catalog">
44
<body id="catalog_moredetail" class="catalog">
21
[% USE KohaDates %]
45
[% USE KohaDates %]
Lines 108-113 Link Here
108
                    [% END %]
132
                    [% END %]
109
133
110
                    [% 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>
111
                        <div class="page-section clearfix">
139
                        <div class="page-section clearfix">
112
                            [% SET not_for_loan = 0 %]
140
                            [% SET not_for_loan = 0 %]
113
                            [% IF ITEM_DAT.notforloan || ITEM_DAT.effective_itemtype.notforloan %]
141
                            [% IF ITEM_DAT.notforloan || ITEM_DAT.effective_itemtype.notforloan %]
Lines 115-123 Link Here
115
                                [% 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 ) %]
116
                            [% END %]
144
                            [% END %]
117
                            <div class="listgroup">
145
                            <div class="listgroup">
118
                                <h3 id="item[% ITEM_DAT.itemnumber | html %]">
119
                                    Barcode [% ITEM_DAT.barcode | html %]  [% IF not_for_loan %][% not_for_loan_description | html %] [% END %]
120
                                </h3>
121
146
122
                                <h4>
147
                                <h4>
123
                                    Item information
148
                                    Item information
Lines 533-540 Link Here
533
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
558
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
534
    [% END %]
559
    [% END %]
535
    <script>
560
    <script>
536
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
561
        $(document).ready(function(){
537
        browser.show();
562
            var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
563
            browser.show();
564
            $(".collapsed, .expanded").on("click",function(e){
565
                e.preventDefault();
566
                var linkid = this.id;
567
                window.scrollTo( 0, getScrollto( linkid, "" ) );
568
                togglePanel( $(this) );
569
            });
570
        });
571
572
        function togglePanel( node ){
573
            var panel = node.next( ".page-section" );
574
            if(panel.is(":visible")){
575
                node.addClass("collapsed").removeClass("expanded").attr("title", __("Click to expand this section") );
576
                panel.hide();
577
            } else {
578
                node.addClass("expanded").removeClass("collapsed").attr("title", __("Click to collapse this section") );
579
                panel.show();
580
            }
581
        }
538
    </script>
582
    </script>
539
[% END %]
583
[% END %]
540
[% INCLUDE 'intranet-bottom.inc' %]
584
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-20 lines)
Lines 219-244 Link Here
219
        $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
219
        $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
220
    }
220
    }
221
221
222
    /**
223
    * Returns a roughly ideal position to scroll an element into view
224
    * @param {string} target - The HTML id of the element to scroll into view
225
    * @param {string} elemid - The HTML id of the element which might obscure
226
    *                          the view of the target element e.g. a floating toolbar
227
    * @return {number} - The y-coordinate to pass to window.scrollTo()
228
    */
229
    function getScrollto( target, elemid ){
230
        var dest = $("#" + target );
231
        var yoffset = dest.offset();
232
233
        if( elemid != "" ){
234
            var element = $("#" + elemid );
235
            var elem_height = element.outerHeight();
236
        } else {
237
            elem_height = 0;
238
        }
239
        return yoffset.top - elem_height - 20;
240
    }
241
242
    function redirect(dest){
222
    function redirect(dest){
243
        $("#redirect").attr("value",dest);
223
        $("#redirect").attr("value",dest);
244
        return Check();
224
        return Check();
(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (-1 / +20 lines)
Lines 880-882 function toggleBtnIcon( element, start, replacement ){ Link Here
880
        });
880
        });
881
    });
881
    });
882
}
882
}
883
- 
883
884
/**
885
* Returns a roughly ideal position to scroll an element into view
886
* @param {string} target - The HTML id of the element to scroll into view
887
* @param {string} elemid - The HTML id of the element which might obscure
888
*                          the view of the target element e.g. a floating toolbar
889
* @return {number} - The y-coordinate to pass to window.scrollTo()
890
*/
891
function getScrollto( target, elemid ){
892
    var dest = $("#" + target );
893
    var yoffset = dest.offset();
894
895
    if( elemid != "" ){
896
        var element = $("#" + elemid );
897
        var elem_height = element.outerHeight();
898
    } else {
899
        elem_height = 0;
900
    }
901
    return yoffset.top - elem_height - 20;
902
}

Return to bug 7508