Skip to content

Commit

Permalink
Reload latest iframe on publish
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Nov 20, 2024
1 parent a13ae75 commit d070cb1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions panel/src/components/Views/PreviewView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
/>
</k-button-group>
</header>
<iframe :src="src.latest"></iframe>
<iframe ref="latest" :src="src.latest"></iframe>
</section>

<section
Expand Down Expand Up @@ -89,7 +89,7 @@
/>
</k-button-group>
</header>
<iframe v-if="hasChanges" :src="src.changes"></iframe>
<iframe v-if="hasChanges" ref="changes" :src="src.changes"></iframe>
<k-empty v-else>
{{ $t("lock.unsaved.empty") }}
<k-button icon="edit" variant="filled" :link="back">
Expand Down Expand Up @@ -141,9 +141,11 @@ export default {
},
mounted() {
this.$events.on("keydown.esc", this.onExit);
this.$events.on("content.publish", this.onPublish);
},
destroyed() {
this.$events.off("keydown.esc", this.onExit);
this.$events.off("content.publish", this.onPublish);
},
methods: {
changeMode(mode) {
Expand All @@ -159,6 +161,9 @@ export default {
}
this.$panel.view.open(this.link);
},
onPublish() {
this.$refs.latest.contentWindow.location.reload();
}
}
};
Expand Down

0 comments on commit d070cb1

Please sign in to comment.