mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
native navbar
This commit is contained in:
1 parent
198a599a2b
commit
7a6b4acea6
5 files changed
+37
-7
No files matched your search
@@ -8,18 +8,23 @@ export default class extends HTMLElement {
|
||||
|
||||
const target = this.querySelector('a, button, [role="button"]') || this.firstElementChild
|
||||
|
||||
if (!target) return
|
||||
if (!target && !this.dataset.native) return
|
||||
|
||||
this.nativeId ||= `native-action-${++counter}`
|
||||
target.dataset.nativeId = this.nativeId
|
||||
|
||||
if (target) target.dataset.nativeId = this.nativeId
|
||||
|
||||
bridge.postMessage({
|
||||
type: 'action',
|
||||
op: 'add',
|
||||
id: this.nativeId,
|
||||
title: this.dataset.label || target.textContent.trim(),
|
||||
title: this.dataset.label || target?.textContent.trim(),
|
||||
icon: this.dataset.icon,
|
||||
placement: this.dataset.placement || 'menu'
|
||||
placement: this.dataset.placement || 'menu',
|
||||
native: this.dataset.native,
|
||||
url: this.dataset.url,
|
||||
accept: this.dataset.accept,
|
||||
destructive: this.dataset.destructive === 'true'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user