Skip to content

Commit cef72d4

Browse files
[6.x] Ensure "cmd + s" bindings are destroyed when moving pages (#13283)
1 parent 3ad8a19 commit cef72d4

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

resources/js/components/blueprints/Builder.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export default {
6262
return {
6363
blueprint: this.initializeBlueprint(),
6464
errors: {},
65+
saveKeyBinding: null,
6566
};
6667
},
6768
@@ -72,7 +73,7 @@ export default {
7273
},
7374
7475
created() {
75-
this.$keys.bindGlobal(['mod+s'], (e) => {
76+
this.saveKeyBinding = this.$keys.bindGlobal(['mod+s'], (e) => {
7677
e.preventDefault();
7778
this.save();
7879
});
@@ -90,6 +91,8 @@ export default {
9091
9192
beforeUnmount() {
9293
this.$events.$off('root-form-save');
94+
95+
this.saveKeyBinding.destroy();
9396
},
9497
9598
watch: {

resources/js/components/entries/PublishForm.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -876,12 +876,9 @@ export default {
876876
877877
beforeUnmount() {
878878
if (this.autosaveIntervalInstance) clearInterval(this.autosaveIntervalInstance);
879-
},
880-
881-
unmounted() {
882-
clearTimeout(this.trackDirtyStateTimeout);
883-
this.saveKeyBinding.destroy();
884-
this.quickSaveKeyBinding.destroy();
879+
clearTimeout(this.trackDirtyStateTimeout);
880+
this.saveKeyBinding.destroy();
881+
this.quickSaveKeyBinding.destroy();
885882
},
886883
};
887884
</script>

resources/js/components/nav/ItemEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default {
7878
});
7979
},
8080
81-
unmounted() {
81+
beforeUnmount() {
8282
this.saveKeyBinding.destroy();
8383
},
8484

resources/js/components/nav/SectionEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default {
5454
});
5555
},
5656
57-
unmounted() {
57+
beforeUnmount() {
5858
this.saveKeyBinding.destroy();
5959
},
6060

resources/js/components/structures/PageEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ export default {
308308
this.getPageValues();
309309
},
310310
311-
unmounted() {
311+
beforeUnmount() {
312312
this.saveKeyBinding.destroy();
313313
},
314314
};

resources/js/components/terms/PublishForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ export default {
517517
window.history.replaceState({}, document.title, document.location.href.replace('created=true', ''));
518518
},
519519
520-
unmounted() {
520+
beforeUnmount() {
521521
this.saveKeyBinding.destroy();
522522
this.quickSaveKeyBinding.destroy();
523523
},

0 commit comments

Comments
 (0)