mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 02:36:36 +00:00
fixed eslint error & integrated with prettier as well as formatted the whole codebase (#3450)
This commit is contained in:
@@ -7,7 +7,7 @@ import functions from './shortcut'
|
||||
|
||||
let shortcuts = CM.get().hotkey
|
||||
|
||||
ee.on('config-renew', function () {
|
||||
ee.on('config-renew', function() {
|
||||
// only update if hotkey changed !
|
||||
const newHotkey = CM.get().hotkey
|
||||
if (!isObjectEqual(newHotkey, shortcuts)) {
|
||||
@@ -15,17 +15,17 @@ ee.on('config-renew', function () {
|
||||
}
|
||||
})
|
||||
|
||||
function updateShortcut (newHotkey) {
|
||||
function updateShortcut(newHotkey) {
|
||||
Mousetrap.reset()
|
||||
shortcuts = newHotkey
|
||||
applyShortcuts(newHotkey)
|
||||
}
|
||||
|
||||
function formatShortcut (shortcut) {
|
||||
function formatShortcut(shortcut) {
|
||||
return shortcut.toLowerCase().replace(/ /g, '')
|
||||
}
|
||||
|
||||
function applyShortcuts (shortcuts) {
|
||||
function applyShortcuts(shortcuts) {
|
||||
for (const shortcut in shortcuts) {
|
||||
const toggler = formatShortcut(shortcuts[shortcut])
|
||||
// only bind if the function for that shortcut exists
|
||||
|
||||
Reference in New Issue
Block a user