mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-07 14:35:26 +02:00
shortcut logic updated
This commit is contained in:
parent
49d610f2f5
commit
5ff587a8af
3 changed files with 8 additions and 18 deletions
|
@ -6,7 +6,7 @@
|
|||
</div>
|
||||
|
||||
<aside class="docs-sidebar__content docs-sidebar__content--invisible">
|
||||
<span>
|
||||
<span class="docs-sidebar__search-wrapper">
|
||||
<input class="docs-sidebar__search" type="text" placeholder="Search" />
|
||||
</span>
|
||||
{% for firstLevelPage in menu %}
|
||||
|
|
|
@ -23,8 +23,7 @@ export default class SidebarFilter {
|
|||
sectionListItem: 'docs-sidebar__section-list-item',
|
||||
sectionListItemWrapperHidden: 'docs-sidebar__section-list-item-wrapper--hidden',
|
||||
sectionListItemSlelected: 'docs-sidebar__section-list-item--selected',
|
||||
sidebarSearchWrapperMac: 'docs-sidebar__search-wrapper-mac',
|
||||
sidebarSearchWrapperOther: 'docs-sidebar__search-wrapper-other',
|
||||
sidebarSearchWrapper: 'docs-sidebar__search-wrapper',
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -57,13 +56,13 @@ export default class SidebarFilter {
|
|||
this.sidebarContent = sidebarContent;
|
||||
this.search = search;
|
||||
this.setSectionCollapsed = setSectionCollapsed;
|
||||
let className = SidebarFilter.CSS.sidebarSearchWrapperOther;
|
||||
let shortcutText = 'Ctrl P';
|
||||
|
||||
// Search initialize with platform specific shortcut.
|
||||
if (window.navigator.userAgent.indexOf('Mac') != -1) {
|
||||
className = SidebarFilter.CSS.sidebarSearchWrapperMac;
|
||||
if (window.navigator.userAgent.indexOf('Mac') !== -1) {
|
||||
shortcutText = '⌘ P';
|
||||
}
|
||||
this.search.parentElement.classList.add(className);
|
||||
this.search.parentElement.setAttribute('data-shortcut', shortcutText);
|
||||
|
||||
// Initialize search input.
|
||||
this.search.value = '';
|
||||
|
|
|
@ -85,21 +85,12 @@
|
|||
padding-right: 45px;
|
||||
line-height: 21px;
|
||||
|
||||
&-wrapper-mac::after {
|
||||
&-wrapper::after {
|
||||
color: var(--color-button-secondary);
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
line-height: 17px;
|
||||
content: "⌘ P";
|
||||
margin-left: -50px;
|
||||
}
|
||||
|
||||
&-wrapper-other::after {
|
||||
color: var(--color-button-secondary);
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
line-height: 17px;
|
||||
content: "Ctrl P";
|
||||
content: attr(data-shortcut);
|
||||
margin-left: -50px;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue