mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Use Mousetrap lib for keyboard shortcuts for hopefully better handling of international keyboards
This commit is contained in:
parent
4a45a8b4fa
commit
0eb520927a
@ -1,5 +1,6 @@
|
||||
const anchorJS = require('anchor-js')
|
||||
const Prism = require('./prism')
|
||||
const Mousetrap = require('mousetrap')
|
||||
|
||||
window.anchors = new anchorJS()
|
||||
window.Vue = require('vue')
|
||||
@ -15,8 +16,6 @@ anchors.options = { placement: 'left', class: 'text-slate-light' }
|
||||
anchors.add()
|
||||
|
||||
// Add shortcut to search input when pressing the "/" key
|
||||
document.onkeyup = function (e) {
|
||||
if (e.which == 191) {
|
||||
document.getElementById('docsearch').focus()
|
||||
}
|
||||
}
|
||||
Mousetrap.bind('/', function (e) {
|
||||
document.getElementById('docsearch').focus()
|
||||
}, 'keyup')
|
||||
|
||||
@ -45,6 +45,7 @@
|
||||
"commander": "^2.11.0",
|
||||
"fs-extra": "^4.0.2",
|
||||
"lodash": "^4.17.4",
|
||||
"mousetrap": "^1.6.1",
|
||||
"nodemon": "^1.11.0",
|
||||
"postcss": "^6.0.9",
|
||||
"postcss-functions": "^3.0.0",
|
||||
|
||||
@ -3035,6 +3035,10 @@ minimist@~0.0.1:
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
mousetrap@^1.6.1:
|
||||
version "1.6.1"
|
||||
resolved "https://registry.yarnpkg.com/mousetrap/-/mousetrap-1.6.1.tgz#2a085f5c751294c75e7e81f6ec2545b29cbf42d9"
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user