2018-07-11 18:00:12 +00:00
|
|
|
<template>
|
|
|
|
<button
|
|
|
|
v-if="link.canDisplay"
|
|
|
|
@click="onClick"
|
|
|
|
:class="['toggle-button', 'toggle-preview', { opened: link.shown }]"/>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: "LinkPreviewToggle",
|
|
|
|
props: {
|
|
|
|
link: Object,
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onClick: function() {
|
|
|
|
this.link.shown = !this.link.shown;
|
|
|
|
|
2018-07-11 20:45:01 +00:00
|
|
|
this.$parent.$emit("linkPreviewToggle", this.link, this.$parent.message);
|
2018-07-11 18:00:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|