mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 14:42:32 -05:00
adjust native
This commit is contained in:
1 parent
6f31bd7af8
commit
66758d45bc
21 files changed
+379
-64
No files matched your search
@@ -1,8 +1,14 @@
|
||||
import { renderStreamMessage } from '@hotwired/turbo'
|
||||
import { renderStreamMessage, session } from '@hotwired/turbo'
|
||||
|
||||
export default class extends HTMLElement {
|
||||
connectedCallback () {
|
||||
if (!this.dataset.src) return
|
||||
if (this.dataset.limit) this.replaceLimitParam()
|
||||
|
||||
if (!this.dataset.src) {
|
||||
this.remove()
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
this.observer = new IntersectionObserver((entries) => {
|
||||
if (entries.some((entry) => entry.isIntersecting)) {
|
||||
@@ -17,6 +23,15 @@ export default class extends HTMLElement {
|
||||
this.observer?.disconnect()
|
||||
}
|
||||
|
||||
replaceLimitParam () {
|
||||
const url = new URL(window.location.href)
|
||||
|
||||
url.searchParams.set('limit', this.dataset.limit)
|
||||
|
||||
session.history.replace(url, session.history.restorationIdentifier)
|
||||
session.view.lastRenderedLocation = url
|
||||
}
|
||||
|
||||
load () {
|
||||
if (this.loading || !this.dataset.src) return
|
||||
|
||||
|
||||
Reference in new issue
Block a user