Skip to content

Commit be4d19f

Browse files
[6.x] Add "mod+s" shortcut to save blueprint order (#13729)
Co-authored-by: Jason Varga <jason@pixelfear.com>
1 parent 0b16849 commit be4d19f

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

resources/js/pages/blueprints/ScopedIndex.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import { ref, computed, watch } from 'vue';
2+
import { ref, computed, watch, onBeforeUnmount } from 'vue';
33
import { Link, router } from '@inertiajs/vue3';
44
import Head from '@/pages/layout/Head.vue';
55
import { Header, Button, DocsCallout, DropdownItem, Listing } from '@ui';
@@ -42,6 +42,15 @@ function saveOrder() {
4242
}
4343
4444
const reloadPage = () => router.reload();
45+
46+
const saveKeyBinding = ref(Statamic.$keys.bindGlobal(['mod+s'], (e) => {
47+
if (hasBeenReordered.value) {
48+
e.preventDefault();
49+
saveOrder();
50+
}
51+
}));
52+
53+
onBeforeUnmount(() => saveKeyBinding.value?.destroy());
4554
</script>
4655
4756
<template>

0 commit comments

Comments
 (0)