1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 10:08:52 +08:00

show message about ClipboardItem support #50

for Firefox
This commit is contained in:
lana-k
2021-08-20 22:30:48 +02:00
parent ead861b610
commit 88c62a1dfb
3 changed files with 7 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
import Lib from 'plotly.js/src/lib'
import dataUrlToBlob from 'dataurl-to-blob'
async function _copyBlob(blob) {
async function _copyBlob (blob) {
await navigator.clipboard.write([
new ClipboardItem({
[blob.type]: blob

View File

@@ -176,8 +176,7 @@ export default {
const canvas = await getPivotCanvas(this.$refs.pivotOutput)
cIo.copyCanvas(canvas)
}
},
}
}
}
</script>

View File

@@ -107,7 +107,11 @@ export default {
return this.$refs.viewComponent.getOptionsForSave()
},
copyToClipboard () {
this.$refs.viewComponent.copyPngToClipboard()
if ('ClipboardItem' in window) {
this.$refs.viewComponent.copyPngToClipboard()
} else {
alert ("Your browser doesn't support copying images into the clipboard. If you use Firefox you can enable it by setting dom.events.asyncClipboard.clipboardItem to true.")
}
}
}
}