2020-03-28 03:37:04 +00:00
|
|
|
function initUiObservers(store, _router) {
|
|
|
|
document.addEventListener('keypress', (event) => {
|
|
|
|
if (event.target.tagName === 'INPUT') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (event.key === 's') {
|
|
|
|
store.dispatch('setSfw', true);
|
|
|
|
}
|
2020-05-08 23:10:07 +00:00
|
|
|
|
|
|
|
if (event.key === 'n') {
|
|
|
|
store.dispatch('setSfw', false);
|
|
|
|
}
|
2020-05-13 00:56:20 +00:00
|
|
|
|
|
|
|
if (event.key === 'd') {
|
|
|
|
store.dispatch('setTheme', 'dark');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (event.key === 'l') {
|
|
|
|
store.dispatch('setTheme', 'light');
|
|
|
|
}
|
2020-03-28 03:37:04 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export default initUiObservers;
|