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 177-203 Link Here
177
        $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
177
        $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
178
    }
178
    }
179
179
180
    /**
181
    * Returns a roughly ideal position to scroll an element into view
182
    * @param {string} target - The HTML id of the element to scroll into view
183
    * @param {string} elemid - The HTML id of the element which might obscure
184
    *                          the view of the target element e.g. a floating toolbar
185
    * @return {number} - The y-coordinate to pass to window.scrollTo()
186
    */
187
    function getScrollto( target, elemid ){
188
        var dest = $("#" + target );
189
        var yoffset = dest.offset();
190
191
        if( elemid != "" ){
192
            var element = $("#" + elemid );
193
            var elem_height = element.outerHeight();
194
        } else {
195
            elem_height = 0;
196
        }
197
        return yoffset.top - elem_height - 20;
198
    }
199
200
201
    /**
180
    /**
202
    * check if z3950 mandatories are set or not
181
    * check if z3950 mandatories are set or not
203
    */
182
    */
(-)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 540-547 Link Here
540
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
565
        [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
541
    [% END %]
566
    [% END %]
542
    <script>
567
    <script>
543
        var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
568
        $(document).ready(function(){
544
        browser.show();
569
            var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
570
            browser.show();
571
            $(".collapsed, .expanded").on("click",function(e){
572
                e.preventDefault();
573
                var linkid = this.id;
574
                window.scrollTo( 0, getScrollto( linkid, "" ) );
575
                togglePanel( $(this) );
576
            });
577
        });
578
579
        function togglePanel( node ){
580
            var panel = node.next( ".page-section" );
581
            if(panel.is(":visible")){
582
                node.addClass("collapsed").removeClass("expanded").attr("title", __("Click to expand this section") );
583
                panel.hide();
584
            } else {
585
                node.addClass("expanded").removeClass("collapsed").attr("title", __("Click to collapse this section") );
586
                panel.show();
587
            }
588
        }
545
    </script>
589
    </script>
546
[% END %]
590
[% END %]
547
[% INCLUDE 'intranet-bottom.inc' %]
591
[% 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