|
|
@@ -1,8 +1,13 @@
|
|
|
-import { onMounted, onUnmounted, Ref } from 'vue'
|
|
|
+import { computed, onMounted, onUnmounted, Ref } from 'vue'
|
|
|
+import { useStore } from 'vuex'
|
|
|
+import { State } from '@/store'
|
|
|
import { getImageDataURL } from '@/utils/image'
|
|
|
import useCreateElement from '@/hooks/useCreateElement'
|
|
|
|
|
|
export default (elementRef: Ref<HTMLElement | null>) => {
|
|
|
+ const store = useStore<State>()
|
|
|
+ const disableHotkeys = computed(() => store.state.disableHotkeys)
|
|
|
+
|
|
|
const { createImageElement } = useCreateElement()
|
|
|
|
|
|
const handleDrop = (e: DragEvent) => {
|
|
|
@@ -17,6 +22,7 @@ export default (elementRef: Ref<HTMLElement | null>) => {
|
|
|
}
|
|
|
else if(dataTransferItem.kind === 'string' && dataTransferItem.type === 'text/plain') {
|
|
|
dataTransferItem.getAsString(text => {
|
|
|
+ if(disableHotkeys.value) return
|
|
|
console.log(text)
|
|
|
})
|
|
|
}
|