Make all content visible when printing
This commit is contained in:
parent
deaab48261
commit
c6fbad3c52
3 changed files with 33 additions and 30 deletions
|
|
@ -1,20 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="[ 'body', topic.title ]">
|
<div :class="['body', topic.title]">
|
||||||
<h3
|
<h3 @click="desiresContent = !desiresContent" class="header">
|
||||||
@click="desiresContent = !desiresContent"
|
<span class="expandToggle" v-html="toggleSymbol"></span>
|
||||||
class="header"
|
|
||||||
>
|
|
||||||
<span class="expandToggle">{{ desiresContent ? '▼ ' : '► '}}</span>
|
|
||||||
<span>{{ topic.title }}</span>
|
<span>{{ topic.title }}</span>
|
||||||
</h3>
|
</h3>
|
||||||
<div v-if="desiresContent">
|
<div v-if="desiresContent || print">
|
||||||
<span
|
<span v-for="message in topic.messages" :key="message.id">
|
||||||
v-for="message in topic.messages"
|
<Message :message="message" />
|
||||||
:key="message.id"
|
|
||||||
>
|
|
||||||
<Message
|
|
||||||
:message="message"
|
|
||||||
/>
|
|
||||||
<span> </span>
|
<span> </span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -22,22 +14,29 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Message from './Message'
|
import Message from "./Message";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Chapter',
|
name: "Chapter",
|
||||||
components: {
|
components: {
|
||||||
Message,
|
Message,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
desiresContent: false,
|
desiresContent: false,
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
props: [
|
props: ["topic", "print"],
|
||||||
'topic',
|
computed: {
|
||||||
],
|
toggleSymbol() {
|
||||||
}
|
let r = "";
|
||||||
|
if (!this.print) {
|
||||||
|
r = this.desiresContent ? "▼ " : "► ";
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
@ -45,6 +44,8 @@ export default {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
@media print {
|
@media print {
|
||||||
.title { display: none; }
|
.title {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,17 +1,18 @@
|
||||||
<template>
|
<template>
|
||||||
<section :class="['content', currentStream]">
|
<section :class="['content', currentStream]">
|
||||||
<h1 class="title"> {{ currentStream.replace('pub-', '') }} </h1>
|
<h1 class="title">{{ currentStream.replace("pub-", "") }}</h1>
|
||||||
<Chapter
|
<Chapter
|
||||||
v-for="topic in sortedTopics"
|
v-for="topic in sortedTopics"
|
||||||
:key="topic.title"
|
:key="topic.title"
|
||||||
:topic="topic"
|
:topic="topic"
|
||||||
|
:print="print"
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters, mapState } from "vuex";
|
import { mapGetters, mapState } from "vuex";
|
||||||
import Chapter from './Chapter.vue';
|
import Chapter from "./Chapter.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Content",
|
name: "Content",
|
||||||
|
|
@ -23,6 +24,7 @@ export default {
|
||||||
...mapGetters(["sortedTopics"]),
|
...mapGetters(["sortedTopics"]),
|
||||||
},
|
},
|
||||||
methods: {},
|
methods: {},
|
||||||
|
props: ["print"],
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<button @click="print">Print</button>
|
<button @click="print">Print</button>
|
||||||
</pane>
|
</pane>
|
||||||
<pane size="55">
|
<pane size="55">
|
||||||
<Content />
|
<Content :print="!show_ui" />
|
||||||
</pane>
|
</pane>
|
||||||
<pane v-if="show_ui" size="35" min-size="15">
|
<pane v-if="show_ui" size="35" min-size="15">
|
||||||
<Rules />
|
<Rules />
|
||||||
|
|
@ -54,7 +54,7 @@ export default {
|
||||||
this.toggle_ui(null, false);
|
this.toggle_ui(null, false);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.print();
|
window.print();
|
||||||
if (prev) this.toggle_ui(null, true);
|
// if (prev) this.toggle_ui(null, true);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
let paged = new Previewer();
|
let paged = new Previewer();
|
||||||
console.log(paged);
|
console.log(paged);
|
||||||
|
|
@ -98,7 +98,7 @@ export default {
|
||||||
overflow: initial;
|
overflow: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
iframe {
|
.print .content iframe {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue