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
1d1564e5
Commit
1d1564e5
authored
5 years ago
by
Silvio Giebl
Browse files
Options
Downloads
Patches
Plain Diff
Improved search layout: scrolling, mobile
parent
9d24b14b
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
_sass/layout.scss
+1
-0
1 addition, 0 deletions
_sass/layout.scss
_sass/search.scss
+34
-17
34 additions, 17 deletions
_sass/search.scss
assets/js/just-the-docs.js
+9
-6
9 additions, 6 deletions
assets/js/just-the-docs.js
with
44 additions
and
23 deletions
_sass/layout.scss
+
1
−
0
View file @
1d1564e5
...
...
@@ -162,6 +162,7 @@
body
{
position
:
relative
;
padding-bottom
:
$sp-10
;
overflow-y
:
scroll
;
@include
mq
(
md
)
{
position
:
static
;
...
...
This diff is collapsed.
Click to expand it.
_sass/search.scss
+
34
−
17
View file @
1d1564e5
...
...
@@ -7,27 +7,25 @@
z-index
:
2
;
flex-grow
:
1
;
height
:
$sp-10
;
padding
-top
:
$sp-2
;
padding-bottom
:
$sp-2
;
padding
:
$sp-2
;
transition
:
padding
linear
100ms
;
@include
mq
(
md
)
{
max-width
:
$search-results-width
;
height
:
100%
;
padding-top
:
0
;
padding-bottom
:
0
;
position
:
relative
!
important
;
width
:
auto
!
important
;
height
:
100%
!
important
;
padding
:
0
;
transition
:
none
;
}
}
.search-input-wrap
{
position
:
relative
;
height
:
100%
;
margin-right
:
$sp-2
;
margin-left
:
$sp-2
;
transition
:
margin
linear
100ms
;
height
:
$sp-8
;
transition
:
height
linear
100ms
;
@include
mq
(
md
)
{
margin-right
:
0
;
margin-left
:
0
;
height
:
100%
!
important
;
transition
:
none
;
}
}
...
...
@@ -47,15 +45,17 @@
border-left
:
0
;
border-radius
:
$border-radius
;
box-shadow
:
0
1px
2px
rgba
(
0
,
0
,
0
,
0
.12
)
,
0
3px
10px
rgba
(
0
,
0
,
0
,
0
.08
);
transition
:
width
ease
200ms
;
@include
fs-4
;
@include
mq
(
md
)
{
max-width
:
$search-results-width
;
padding-top
:
$gutter-spacing-sm
;
padding-left
:
#{
$gutter-spacing
+
$sp-5
}
;
padding-bottom
:
$gutter-spacing-sm
;
background-color
:
$body-background-color
;
border-radius
:
0
;
box-shadow
:
none
;
transition
:
width
ease
200ms
;
@include
fs-3
;
}
...
...
@@ -88,9 +88,10 @@
.search-results
{
position
:
absolute
;
left
:
0
;
display
:
none
;
width
:
100%
;
max-height
:
calc
(
100
vh
-
100%
);
max-height
:
calc
(
100
%
-
#{
$sp-10
}
);
overflow-y
:
auto
;
background
:
$search-background-color
;
border-bottom-right-radius
:
$border-radius
;
...
...
@@ -99,6 +100,7 @@
@include
mq
(
md
)
{
width
:
$search-results-width
;
max-height
:
calc
(
100vh
-
200%
)
!
important
;
}
}
...
...
@@ -213,11 +215,17 @@
}
.search-active
{
overflow
:
hidden
;
.search
{
position
:
fixed
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
padding
:
0
;
}
.search-input-wrap
{
margin-right
:
0
;
margin-left
:
0
;
height
:
$sp-10
;
}
.search-input
{
...
...
@@ -239,4 +247,13 @@
opacity
:
1
;
transition
:
opacity
ease
200ms
,
width
0s
,
height
0s
;
}
@include
mq
(
md
)
{
.main
{
position
:
absolute
;
height
:
100vh
;
width
:
100vw
;
overflow
:
hidden
;
}
}
}
This diff is collapsed.
Click to expand it.
assets/js/just-the-docs.js
+
9
−
6
View file @
1d1564e5
...
...
@@ -112,13 +112,17 @@ function initSearch() {
var
searchInput
=
document
.
getElementById
(
'
search-input
'
);
var
searchResults
=
document
.
getElementById
(
'
search-results
'
);
function
hide
Results
()
{
function
clear
Results
()
{
searchResults
.
innerHTML
=
''
;
document
.
body
.
classList
.
remove
(
'
search-active
'
);
hideResults
();
}
function
hideResults
()
{
document
.
documentElement
.
classList
.
remove
(
'
search-active
'
);
}
function
update
()
{
hide
Results
();
clear
Results
();
var
input
=
searchInput
.
value
;
if
(
input
===
''
)
{
...
...
@@ -136,8 +140,7 @@ function initSearch() {
});
if
(
results
.
length
>
0
)
{
window
.
scroll
(
0
,
window
.
scrollY
+
searchInput
.
getBoundingClientRect
().
top
);
document
.
body
.
classList
.
add
(
'
search-active
'
);
document
.
documentElement
.
classList
.
add
(
'
search-active
'
);
var
resultsList
=
document
.
createElement
(
'
ul
'
);
resultsList
.
classList
.
add
(
'
search-results-list
'
);
...
...
@@ -242,7 +245,7 @@ function initSearch() {
jtd
.
addEvent
(
searchInput
,
'
keyup
'
,
function
(
e
){
switch
(
e
.
keyCode
)
{
case
27
:
// When esc key is pressed, hide the results and clear the field
hide
Results
();
clear
Results
();
searchInput
.
value
=
''
;
return
;
case
38
:
// arrow up
...
...
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