forked from vikunja/frontend
18 lines
362 B
TypeScript
18 lines
362 B
TypeScript
import {Directive} from 'vue'
|
|
import {install, uninstall} from '@github/hotkey'
|
|
import {isMac} from '@/helpers/isMac'
|
|
|
|
const directive: Directive = {
|
|
mounted(el, {value}) {
|
|
if (isMac() && value.includes('Control')) {
|
|
value = value.replace('Control', 'Meta')
|
|
}
|
|
install(el, value)
|
|
},
|
|
beforeUnmount(el) {
|
|
uninstall(el)
|
|
},
|
|
}
|
|
|
|
export default directive
|