Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Community Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bio-IT
Community Documentation
Commits
eaf12479
Unverified
Commit
eaf12479
authored
6 years ago
by
Patrick Marsceill
Browse files
Options
Downloads
Patches
Plain Diff
Auto focus main content for keyboard scrolling
parent
eb0a6c32
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
_layouts/default.html
+2
-2
2 additions, 2 deletions
_layouts/default.html
_sass/layout.scss
+4
-0
4 additions, 0 deletions
_sass/layout.scss
assets/js/just-the-docs.js
+7
-0
7 additions, 0 deletions
assets/js/just-the-docs.js
with
13 additions
and
2 deletions
_layouts/default.html
+
2
−
2
View file @
eaf12479
...
...
@@ -20,7 +20,7 @@
{% if site.search_enabled != nil %}
<div
class=
"search js-search"
>
<div
class=
"search-input-wrap"
>
<input
type=
"text"
class=
"js-search-input search-input"
placeholder=
"Search {{ site.title }}"
aria-label=
"Search {{ site.title }}"
autocomplete=
"off"
>
<input
type=
"text"
class=
"js-search-input search-input"
tabindex=
"0"
placeholder=
"Search {{ site.title }}"
aria-label=
"Search {{ site.title }}"
autocomplete=
"off"
>
<svg
width=
"14"
height=
"14"
viewBox=
"0 0 28 28"
xmlns=
"http://www.w3.org/2000/svg"
class=
"search-icon"
><title>
Search
</title><g
fill-rule=
"nonzero"
><path
d=
"M17.332 20.735c-5.537 0-10-4.6-10-10.247 0-5.646 4.463-10.247 10-10.247 5.536 0 10 4.601 10 10.247s-4.464 10.247-10 10.247zm0-4c3.3 0 6-2.783 6-6.247 0-3.463-2.7-6.247-6-6.247s-6 2.784-6 6.247c0 3.464 2.7 6.247 6 6.247z"
/><path
d=
"M11.672 13.791L.192 25.271 3.02 28.1 14.5 16.62z"
/></g></svg>
</div>
<div
class=
"js-search-results search-results-wrap"
></div>
...
...
@@ -35,7 +35,7 @@
{% endif %}
</div>
</div>
<div
class=
"main-content"
>
<div
class=
"main-content
js-main-content"
tabindex=
"1
"
>
{% unless page.url == "/" %}
{% if page.parent %}
<nav
class=
"breadcrumb-nav"
>
...
...
This diff is collapsed.
Click to expand it.
_sass/layout.scss
+
4
−
0
View file @
eaf12479
...
...
@@ -74,6 +74,10 @@
}
}
.js-main-content
:focus
{
outline
:
none
;
}
.page-header
{
background-color
:
$sidebar-color
;
...
...
This diff is collapsed.
Click to expand it.
assets/js/just-the-docs.js
+
7
−
0
View file @
eaf12479
...
...
@@ -150,11 +150,18 @@ function initSearch() {
}
}
function
pageFocus
()
{
var
mainContent
=
document
.
querySelector
(
'
.js-main-content
'
);
mainContent
.
focus
();
console
.
log
(
mainContent
)
}
// Document ready
function
ready
(){
toggleNav
();
pageFocus
();
if
(
typeof
lunr
!==
'
undefined
'
)
{
initSearch
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment