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 (-6 / +50 lines)
Lines 14-20 Link Here
14
    [% t("Koha") | html %]
14
    [% t("Koha") | html %]
15
[% END %]</title>
15
[% END %]</title>
16
[% INCLUDE 'doc-head-close.inc' %]
16
[% INCLUDE 'doc-head-close.inc' %]
17
<style>.listgroup .rows{margin-left:1em;}</style>
17
[% FILTER collapse %]
18
    <style>
19
        .listgroup .rows{
20
            margin-left: 1em;
21
        }
22
        h3 {
23
            background-color: #FFF;
24
            border: 1px solid #FFF;
25
            margin-bottom: 0;
26
            padding: 1rem;
27
        }
28
        h3:hover {
29
            border: 1px solid #6FAF44;
30
            cursor: pointer;
31
        }
32
        h3 i {
33
            color: #4C7AA8;
34
            font-size: 80%;
35
            padding-right: .2rem;
36
        }
37
        h3.collapsed i.fa.fa-caret-down::before {
38
           content: "\f0da";
39
        }
40
    </style>
41
[% END %]
18
</head>
42
</head>
19
<body id="catalog_moredetail" class="catalog">
43
<body id="catalog_moredetail" class="catalog">
20
[% USE KohaDates %]
44
[% USE KohaDates %]
Lines 107-112 Link Here
107
                    [% END %]
131
                    [% END %]
108
132
109
                    [% FOREACH ITEM_DAT IN ITEM_DATA %]
133
                    [% FOREACH ITEM_DAT IN ITEM_DATA %]
134
                        <h3 id="item[% ITEM_DAT.itemnumber | html %]" class="expanded">
135
                            <i class="fa fa-caret-down" title="Collapse this section"></i>
136
                            Barcode [% ITEM_DAT.barcode | html %]  [% IF not_for_loan %][% not_for_loan_description | html %] [% END %]
137
                        </h3>
110
                        <div class="page-section clearfix">
138
                        <div class="page-section clearfix">
111
                            [% SET not_for_loan = 0 %]
139
                            [% SET not_for_loan = 0 %]
112
                            [% IF ITEM_DAT.notforloan || ITEM_DAT.effective_itemtype.notforloan %]
140
                            [% IF ITEM_DAT.notforloan || ITEM_DAT.effective_itemtype.notforloan %]
Lines 114-122 Link Here
114
                                [% SET not_for_loan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
142
                                [% SET not_for_loan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
115
                            [% END %]
143
                            [% END %]
116
                            <div class="listgroup">
144
                            <div class="listgroup">
117
                                <h3 id="item[% ITEM_DAT.itemnumber | html %]">
118
                                    Barcode [% ITEM_DAT.barcode | html %]  [% IF not_for_loan %][% not_for_loan_description | html %] [% END %]
119
                                </h3>
120
145
121
                                <h4>
146
                                <h4>
122
                                    Item information
147
                                    Item information
Lines 539-546 Link Here
539
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
564
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
540
    [% END %]
565
    [% END %]
541
    <script>
566
    <script>
542
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
567
        $(document).ready(function(){
543
        browser.show();
568
            var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
569
            browser.show();
570
            $(".collapsed, .expanded").on("click",function(e){
571
                e.preventDefault();
572
                var linkid = this.id;
573
                window.scrollTo( 0, getScrollto( linkid, "" ) );
574
                togglePanel( $(this) );
575
            });
576
        });
577
578
        function togglePanel( node ){
579
            var panel = node.next( ".page-section" );
580
            if(panel.is(":visible")){
581
                node.addClass("collapsed").removeClass("expanded").attr("title", __("Click to expand this section") );
582
                panel.hide();
583
            } else {
584
                node.addClass("expanded").removeClass("collapsed").attr("title", __("Click to collapse this section") );
585
                panel.show();
586
            }
587
        }
544
    </script>
588
    </script>
545
[% END %]
589
[% END %]
546
[% INCLUDE 'intranet-bottom.inc' %]
590
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-20 lines)
Lines 211-236 Link Here
211
        $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
211
        $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
212
    }
212
    }
213
213
214
    /**
215
    * Returns a roughly ideal position to scroll an element into view
216
    * @param {string} target - The HTML id of the element to scroll into view
217
    * @param {string} elemid - The HTML id of the element which might obscure
218
    *                          the view of the target element e.g. a floating toolbar
219
    * @return {number} - The y-coordinate to pass to window.scrollTo()
220
    */
221
    function getScrollto( target, elemid ){
222
        var dest = $("#" + target );
223
        var yoffset = dest.offset();
224
225
        if( elemid != "" ){
226
            var element = $("#" + elemid );
227
            var elem_height = element.outerHeight();
228
        } else {
229
            elem_height = 0;
230
        }
231
        return yoffset.top - elem_height - 20;
232
    }
233
234
    function redirect(dest){
214
    function redirect(dest){
235
        $("#redirect").attr("value",dest);
215
        $("#redirect").attr("value",dest);
236
        return Check();
216
        return Check();
(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (-1 / +20 lines)
Lines 911-913 function toggleBtnIcon( element, start, replacement ){ Link Here
911
        });
911
        });
912
    });
912
    });
913
}
913
}
914
- 
914
915
/**
916
* Returns a roughly ideal position to scroll an element into view
917
* @param {string} target - The HTML id of the element to scroll into view
918
* @param {string} elemid - The HTML id of the element which might obscure
919
*                          the view of the target element e.g. a floating toolbar
920
* @return {number} - The y-coordinate to pass to window.scrollTo()
921
*/
922
function getScrollto( target, elemid ){
923
    var dest = $("#" + target );
924
    var yoffset = dest.offset();
925
926
    if( elemid != "" ){
927
        var element = $("#" + elemid );
928
        var elem_height = element.outerHeight();
929
    } else {
930
        elem_height = 0;
931
    }
932
    return yoffset.top - elem_height - 20;
933
}

Return to bug 7508