traxxx/assets/js/ui/observers.js

26 lines
581 B
JavaScript
Raw Normal View History

function initUiObservers(store, _router) {
document.addEventListener('keypress', (event) => {
if (event.target.tagName === 'INPUT') {
return;
}
if (event.key === 's') {
store.dispatch('setSfw', true);
}
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');
}
});
}
export default initUiObservers;