Skip to content

Commit 0b16849

Browse files
[6.x] Add "mod+s" shortcut to save collection order (#13724)
1 parent 87d0770 commit 0b16849

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

resources/js/components/entries/Listing.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export default {
7272
items: null,
7373
page: null,
7474
perPage: null,
75+
saveKeyBinding: null,
7576
};
7677
},
7778
@@ -86,7 +87,20 @@ export default {
8687
},
8788
},
8889
89-
methods: {
90+
created() {
91+
this.saveKeyBinding = this.$keys.bindGlobal(['mod+s'], (e) => {
92+
if (this.reordering) {
93+
e.preventDefault();
94+
this.saveOrder();
95+
}
96+
});
97+
},
98+
99+
beforeUnmount() {
100+
this.saveKeyBinding.destroy();
101+
},
102+
103+
methods: {
90104
requestComplete({ items, parameters, activeFilters }) {
91105
this.items = items;
92106
this.page = parameters.page;

0 commit comments

Comments
 (0)