2018-02-10 07:56:33 +02:00
|
|
|
<template>
|
|
|
|
<div>
|
2018-02-20 15:53:34 +02:00
|
|
|
<x-header/>
|
2018-02-12 12:59:24 +02:00
|
|
|
<div class="content">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
2018-02-18 05:35:18 +02:00
|
|
|
<mk-stream-indicator v-if="os.isSignedIn"/>
|
2018-02-10 07:56:33 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
2018-02-12 12:59:24 +02:00
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-02-20 15:53:34 +02:00
|
|
|
import XHeader from './ui.header.vue';
|
2018-02-12 12:59:24 +02:00
|
|
|
|
|
|
|
export default Vue.extend({
|
2018-02-20 15:53:34 +02:00
|
|
|
components: {
|
2018-02-20 18:39:51 +02:00
|
|
|
XHeader
|
2018-02-20 15:53:34 +02:00
|
|
|
},
|
2018-02-12 12:59:24 +02: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 15:53:34 +02:00
|
|
|
(this as any).apis.post();
|
2018-02-12 12:59:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|