mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 06:42:32 -05:00
make submission header buttons native
This commit is contained in:
1 parent
359f695eb5
commit
9abdb68bc5
5 files changed
+79
-55
No files matched your search
@@ -6,7 +6,9 @@ export default class extends HTMLElement {
|
||||
const text = this.dataset.text || this.innerText.trim()
|
||||
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(text)
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
window.webkit?.messageHandlers?.flash?.postMessage({ style: 'notice', message: this.dataset.copied })
|
||||
})
|
||||
} else {
|
||||
if (e.target.tagName !== 'INPUT') {
|
||||
alert(`Clipboard not available. Make sure you're using https://\nCopy text: ${text}`)
|
||||
|
||||
@@ -21,6 +21,10 @@ export default targetable(class extends HTMLElement {
|
||||
downloadFiles () {
|
||||
if (!this.dataset.src) return
|
||||
|
||||
const download = window.webkit?.messageHandlers?.download
|
||||
|
||||
if (download) return download.postMessage({ src: this.dataset.src })
|
||||
|
||||
this.toggleState()
|
||||
|
||||
fetch(this.dataset.src).then(async (response) => {
|
||||
|
||||
@@ -6,7 +6,7 @@ export default class extends HTMLElement {
|
||||
|
||||
if (!bridge) return
|
||||
|
||||
const target = this.querySelector('a, button, [role="button"]')
|
||||
const target = this.querySelector('a, button, [role="button"]') || this.firstElementChild
|
||||
|
||||
if (!target) return
|
||||
|
||||
|
||||
Reference in new issue
Block a user