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