2018-02-10 06:56:33 +01:00
|
|
|
<template>
|
2018-05-31 09:44:11 +02:00
|
|
|
<div class="mk-ui">
|
|
|
|
<x-header class="header"/>
|
2018-02-12 11:59:24 +01:00
|
|
|
<div class="content">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
2018-05-27 06:49:09 +02:00
|
|
|
<mk-stream-indicator v-if="$store.getters.isSignedIn"/>
|
2018-02-10 06:56:33 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
2018-02-12 11:59:24 +01:00
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-02-20 14:53:34 +01:00
|
|
|
import XHeader from './ui.header.vue';
|
2018-02-12 11:59:24 +01:00
|
|
|
|
|
|
|
export default Vue.extend({
|
2018-02-20 14:53:34 +01:00
|
|
|
components: {
|
2018-02-20 17:39:51 +01:00
|
|
|
XHeader
|
2018-02-20 14:53:34 +01:00
|
|
|
},
|
2018-02-12 11:59:24 +01:00
|
|
|
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();
|
2018-02-20 14:53:34 +01:00
|
|
|
(this as any).apis.post();
|
2018-02-12 11:59:24 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2018-05-31 09:44:11 +02:00
|
|
|
<style lang="stylus" scoped>
|
|
|
|
.mk-ui
|
|
|
|
> .header
|
|
|
|
@media (max-width 1000px)
|
|
|
|
display none
|
|
|
|
</style>
|