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

(-)a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css (-1 / +2 lines)
Lines 6-12 div#toolbar { Link Here
6
    border: 0;
6
    border: 0;
7
}
7
}
8
8
9
#addbibliotabs .ui-tabs-nav {
9
#addbibliotabs .ui-tabs-nav,
10
#authoritytabs .ui-tabs-nav {
10
    display: none;
11
    display: none;
11
}
12
}
12
13
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt (-2 / +90 lines)
Lines 21-27 Link Here
21
    });
21
    });
22
    var Sticky;
22
    var Sticky;
23
    $(document).ready(function() {
23
    $(document).ready(function() {
24
        var tabs = $('#authoritytabs').tabs();
24
        var tabs = $('#authoritytabs').tabs().bind('show.ui-tabs', function(e, ui) {
25
            $("#"+ui.panel.id+" input:eq(0)").focus();
26
        });
27
28
        $( "ul.sortable_field", tabs ).sortable();
29
        $( "ul.sortable_subfield", tabs ).sortable();
30
31
        [% IF tab %]
32
            link = $("a[href='#[% tab | html %]']");
33
            selectTab( link );
34
        [% END %]
25
        $( "ul.sortable_field", tabs ).sortable();
35
        $( "ul.sortable_field", tabs ).sortable();
26
        $( "ul.sortable_subfield", tabs ).sortable();
36
        $( "ul.sortable_subfield", tabs ).sortable();
27
        Sticky = $("#toolbar");
37
        Sticky = $("#toolbar");
Lines 42-49 Link Here
42
            }
52
            }
43
            return false;
53
            return false;
44
        });
54
        });
55
        $(".toolbar-tabs a").on("click",function(e){
56
            e.preventDefault();
57
            selectTab( $(this ) );
58
        });
59
60
        $(".tag_anchor").on("click", function(e){
61
            e.preventDefault();
62
            $(".tag_anchor").removeClass("selected");
63
            $(this).addClass("selected");
64
            var link = this.href;
65
            var linkid = link.substring( link.indexOf("#") + 1 );
66
            window.scrollTo( 0, getScrollto( linkid, "toolbar" ) );
67
        });
68
69
        $("body").on("click", ".linkfield", function(e){
70
            e.preventDefault();
71
            var tab = $(this).data("tab");
72
            var field = $(this).data("field");
73
            var tablink = $("a[data-tabid='" + tab + "']" );
74
            selectTab( tablink );
75
            window.scrollTo( 0, getScrollto( field, "toolbar" ) );
76
        });
45
    });
77
    });
46
78
79
    function selectTab( tablink ){
80
        $(".toolbar-tabs li").removeClass("selected");
81
        tablink.parent().addClass("selected");
82
        var tabid = tablink.data("tabid");
83
        $('#authoritytabs').selectTabByID("#tab" + tabid + "XX");
84
        $(".tag_anchors").removeClass("tab_selected").hide();
85
        $(".tag_anchors_" + tabid ).addClass("tab_selected").show();
86
    }
87
88
    /**
89
    * Returns a roughly ideal position to scroll an element into view
90
    * @param {string} target - The HTML id of the element to scroll into view
91
    * @param {string} elemid - The HTML id of the element which might obscure
92
    *                          the view of the target element e.g. a floating toolbar
93
    * @return {number} - The y-coordinate to pass to window.scrollTo()
94
    */
95
    function getScrollto( target, elemid ){
96
        var dest = $("#" + target );
97
        var yoffset = dest.offset();
98
99
        if( elemid != "" ){
100
            var element = $("#" + elemid );
101
            var elem_height = element.outerHeight();
102
        } else {
103
            elem_height = 0;
104
        }
105
        return yoffset.top - elem_height - 20;
106
    }
107
108
47
    /**
109
    /**
48
    * check if z3950 mandatories are set or not
110
    * check if z3950 mandatories are set or not
49
    */
111
    */
Lines 262-267 Link Here
262
                                <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/authorities-home.pl">Cancel</a>
324
                                <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/authorities-home.pl">Cancel</a>
263
                            [% END %]
325
                            [% END %]
264
                        </div>
326
                        </div>
327
                        <div class="toolbar-tabs-container">
328
                            [% IF ( BIG_LOOP && BIG_LOOP.size > 1 ) %]
329
                                <ul class="toolbar-tabs">
330
                                    [%- FOREACH BIG_LOO IN BIG_LOOP -%]
331
                                        [% IF loop.first %]
332
                                            <li class="selected">
333
                                        [% ELSE %]
334
                                            <li>
335
                                        [% END %]
336
                                            <a data-tabid="[% BIG_LOO.number | html %]" href="#tab[% BIG_LOO.number | html %]XX">[% BIG_LOO.number | html %]</a>
337
                                        </li>
338
                                    [%- END -%]
339
                                </ul>
340
                            [% END %]
341
                            <ul class="tag_anchors_list">
342
                                [% FOREACH BIG_LOO IN BIG_LOOP %]
343
                                    [% IF loop.first %][% SET tab_selected = "tab_selected" %][% ELSE %][% SET tab_selected = "" %][% END %]
344
                                    [% FOREACH innerloo IN BIG_LOO.innerloop %]
345
                                        [% IF ( innerloo.tag ) %]
346
                                            <li class="tag_anchors tag_anchors_[% BIG_LOO.number | html %] [% tab_selected | html %]">
347
                                                <a class="tag_anchor" id="tag_anchor_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]" title="tag_anchor_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]" href="#div_indicator_tag_[% innerloo.tag | uri %]_[% innerloo.index | uri %][% innerloo.random | uri %]">[% innerloo.tag | uri %]</a>
348
                                            </li>
349
                                        [% END %]
350
                                    [% END %]
351
                                [% END %]
352
                            </ul>
353
                        </div>
265
                    </div> <!-- /#toolbar -->
354
                    </div> <!-- /#toolbar -->
266
355
267
                    <div id="authoritytabs" class="toptabs numbered">
356
                    <div id="authoritytabs" class="toptabs numbered">
268
- 

Return to bug 24415