mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 11:53:08 +02:00
43 lines
818 B
Vue
43 lines
818 B
Vue
<template>
|
|
<div class="mk-ui">
|
|
<x-header class="header"/>
|
|
<div class="content">
|
|
<slot></slot>
|
|
</div>
|
|
<mk-stream-indicator v-if="$store.getters.isSignedIn"/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import Vue from 'vue';
|
|
import XHeader from './ui.header.vue';
|
|
|
|
export default Vue.extend({
|
|
components: {
|
|
XHeader
|
|
},
|
|
mounted() {
|
|
document.addEventListener('keydown', this.onKeydown);
|
|
},
|
|
beforeDestroy() {
|
|
document.removeEventListener('keydown', this.onKeydown);
|
|
},
|
|
methods: {
|
|
onKeydown(e) {
|
|
if (e.target.tagName == 'INPUT' || e.target.tagName == 'TEXTAREA') return;
|
|
|
|
if (e.which == 80 || e.which == 78) { // p or n
|
|
e.preventDefault();
|
|
(this as any).apis.post();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<style lang="stylus" scoped>
|
|
.mk-ui
|
|
> .header
|
|
@media (max-width 1000px)
|
|
display none
|
|
</style>
|