Skip to content

Commit

Permalink
[4.x] Refresh Live Preview when relationship items are updated (#8893)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean authored Oct 30, 2023
1 parent 4a753dc commit 89bd9d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions resources/js/components/inputs/relationship/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export default {
InlineEditForm
},
inject: ['storeName'],
props: {
item: Object,
config: Object,
Expand Down Expand Up @@ -83,6 +85,8 @@ export default {
this.item.published = responseData.published;
this.item.private = responseData.private;
this.item.status = responseData.status;
this.$events.$emit(`live-preview.${this.storeName}.refresh`);
},
}
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/live-preview/LivePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ export default {
this.keybinding = this.$keys.bindGlobal('mod+shift+p', () => {
this.previewing ? this.close() : this.$emit('opened-via-keyboard');
});
this.$events.$on(`live-preview.${this.name}.refresh`, () => {
this.update();
});
},
beforeDestroy() {
Expand Down

0 comments on commit 89bd9d5

Please sign in to comment.