mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-11 18:02:28 +03:00
Change shortcut key for search to join command palette fad, but preserve old shortcut too
This commit is contained in:
@@ -14,12 +14,17 @@
|
||||
var siteDocsVersion = inputElement.getAttribute('data-bd-docs-version')
|
||||
|
||||
document.addEventListener('keydown', function (event) {
|
||||
if (event.ctrlKey && event.key === '/') {
|
||||
if ((((event.ctrlKey || event.metaKey) && event.key === 'k')) || (event.ctrlKey && event.key === '/')) {
|
||||
event.preventDefault()
|
||||
inputElement.focus()
|
||||
}
|
||||
})
|
||||
|
||||
if (navigator.platform.includes('Windows')) {
|
||||
var searchShortcut = document.querySelector('.bd-search')
|
||||
searchShortcut.setAttribute('data-shortcut', '⌃K')
|
||||
}
|
||||
|
||||
window.docsearch({
|
||||
apiKey: '5990ad008512000bba2cf951ccf0332f',
|
||||
indexName: 'bootstrap',
|
||||
|
||||
Reference in New Issue
Block a user