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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (+1 lines)
Lines 12-17 Link Here
12
        <div class="navbar navbar-inverse navbar-static-top">
12
        <div class="navbar navbar-inverse navbar-static-top">
13
            <div class="navbar-inner">
13
            <div class="navbar-inner">
14
                <div class="container-fluid">
14
                <div class="container-fluid">
15
                    <button id="scrolltocontent" class="sr-only sr-only-focusable pull-left nav btn btn-danger" type="button">Skip to main content</button>
15
                    <h1 id="logo">
16
                    <h1 id="logo">
16
                        <a class="brand" href="/cgi-bin/koha/opac-main.pl">
17
                        <a class="brand" href="/cgi-bin/koha/opac-main.pl">
17
                            [% IF ( LibraryNameTitle ) %]
18
                            [% IF ( LibraryNameTitle ) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/global.js (-1 / +46 lines)
Lines 91-93 function confirmModal(message, title, yes_label, no_label, callback) { Link Here
91
    $("#bootstrap-confirm-box-modal-cancel").text( no_label || 'Cancel' );
91
    $("#bootstrap-confirm-box-modal-cancel").text( no_label || 'Cancel' );
92
    $("#bootstrap-confirm-box-modal").modal('show');
92
    $("#bootstrap-confirm-box-modal").modal('show');
93
}
93
}
94
- 
94
95
//Add jQuery :focusable selector
96
(function($) {
97
    function visible(element) {
98
        return $.expr.filters.visible(element) && !$(element).parents().addBack().filter(function() {
99
            return $.css(this, 'visibility') === 'hidden';
100
        }).length;
101
    }
102
103
    function focusable(element, isTabIndexNotNaN) {
104
        var map, mapName, img, nodeName = element.nodeName.toLowerCase();
105
        if ('area' === nodeName) {
106
            map = element.parentNode;
107
            mapName = map.name;
108
            if (!element.href || !mapName || map.nodeName.toLowerCase() !== 'map') {
109
                return false;
110
            }
111
            img = $('img[usemap=#' + mapName + ']')[0];
112
            return !!img && visible(img);
113
        }
114
        return (/input|select|textarea|button|object/.test(nodeName) ?
115
                !element.disabled :
116
                'a' === nodeName ?
117
                element.href || isTabIndexNotNaN :
118
                isTabIndexNotNaN) &&
119
            // the element and all of its ancestors must be visible
120
            visible(element);
121
    }
122
123
    $.extend($.expr[':'], {
124
        focusable: function(element) {
125
            return focusable(element, !isNaN($.attr(element, 'tabindex')));
126
        }
127
    });
128
})(jQuery);
129
130
$("#scrolltocontent").click(function() {
131
    var content = $(".maincontent");
132
    if (content.length > 0) {
133
        $('html,body').animate({
134
                scrollTop: content.first().offset().top
135
            },
136
        'slow');
137
        content.first().find(':focusable').eq(0).focus();
138
    }
139
});

Return to bug 22807