🌐 AI搜索 & 代理 主页
Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix search on top in documentation
  • Loading branch information
raviteja83 committed Jun 3, 2019
commit 9c693e05aa2e189ccc7d6aa65fbaaae3cae69291
34 changes: 23 additions & 11 deletions assets/css/_docs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ html.docs {
position: relative;
}

h2, h3, h4 {
h2,
h3,
h4 {
white-space: nowrap;
}

Expand Down Expand Up @@ -170,6 +172,8 @@ html.docs {
.search {
position: relative;
width: 100%;
margin: 2.4rem 0 0;
padding: 0 2.4rem;

input {
appearance: none;
Expand All @@ -189,30 +193,37 @@ html.docs {
.fa-search {
color: #979797;
font-size: 1.5rem;
left: 7px;
left: 24px;
position: absolute;
top: 5px;
top: 3px;
}
}

.toc-container {
@include minimal-scrollbar();

background-color: $foreground;
display: none;
flex: none;
height: 100%;
min-width: 310px;
overflow-y: auto;
padding: 2.4rem;
position: absolute;
right: 0;
top: 0;
transform: translateZ(0);
white-space: nowrap;
will-change: scroll-position;
z-index: 1;
-webkit-overflow-scrolling: touch;

.toc-menu-container {
height: 100%;
}

.react-menu-container {
@include minimal-scrollbar();
padding: 0 2.4rem 2.4rem;
overflow-y: auto;
height: calc(100% - 6rem);
will-change: scroll-position;
-webkit-overflow-scrolling: touch;
}

&.open {
display: block;
Expand All @@ -227,7 +238,7 @@ html.docs {
}

// Avoid page jank when the search bar initializes.
> div:first-child:not(.search):not(.react-menu-container) {
> div:first-child:not(.toc-menu-container):not(.search):not(.react-menu-container) {
margin-top: calc(2.4rem + 33px);

h2 {
Expand Down Expand Up @@ -270,7 +281,8 @@ html.docs {
font-size: 1.4rem;
}

.fa-minus-square-o, .fa-plus-square-o {
.fa-minus-square-o,
.fa-plus-square-o {
cursor: pointer;
font-size: 1.4rem;
margin-right: 1.1rem;
Expand Down
17 changes: 11 additions & 6 deletions assets/js/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
return React.createElement(
'div',
{
'className': 'react-menu-container'
'className': 'toc-menu-container'
},
React.createElement(
'div',
Expand All @@ -353,16 +353,21 @@
}
)
),
elements,
React.createElement(
'div',
{
'className': className('empty-state', this.state.searchFound ? 'hidden' : '')
'className': 'react-menu-container'
},
'Sorry, no matches.'
elements,
React.createElement(
'div',
{
'className': className('empty-state', this.state.searchFound ? 'hidden' : '')
},
'Sorry, no matches.'
)
)
)
}
)}
})

/*--------------------------------------------------------------------------*/
Expand Down
Loading