Do not show toggle arrow if link data is still loading
This commit is contained in:
parent
05303e4cf1
commit
e5b3c518e2
@ -146,11 +146,6 @@ export default {
|
|||||||
this.link.shown = this.link.shown && shouldOpenByDefault;
|
this.link.shown = this.link.shown && shouldOpenByDefault;
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// Don't display previews while they are loading on the server
|
|
||||||
if (this.link.type === "loading") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$root.$on("resize", this.handleResize);
|
this.$root.$on("resize", this.handleResize);
|
||||||
|
|
||||||
this.onPreviewUpdate();
|
this.onPreviewUpdate();
|
||||||
@ -165,6 +160,11 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onPreviewUpdate() {
|
onPreviewUpdate() {
|
||||||
|
// Don't display previews while they are loading on the server
|
||||||
|
if (this.link.type === "loading") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Error don't have any media to render
|
// Error don't have any media to render
|
||||||
if (this.link.type === "error") {
|
if (this.link.type === "error") {
|
||||||
this.onPreviewReady();
|
this.onPreviewReady();
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<button
|
<button
|
||||||
|
v-if="link.type !== 'loading'"
|
||||||
:class="['toggle-button', 'toggle-preview', { opened: link.shown }]"
|
:class="['toggle-button', 'toggle-preview', { opened: link.shown }]"
|
||||||
@click="onClick" />
|
@click="onClick" />
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user