Skip to content

Commit a1bf41a

Browse files
committed
moved csrf field getter to end of class and added "setter" method.
1 parent 6f7137a commit a1bf41a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ export default class AutoCheckElement extends HTMLElement {
6262
return link.href
6363
}
6464

65-
get csrfField(): string {
66-
return this.getAttribute('csrf-field') || 'authenticity_token'
67-
}
68-
6965
set src(value: string) {
7066
this.setAttribute('src', value)
7167
}
@@ -90,6 +86,14 @@ export default class AutoCheckElement extends HTMLElement {
9086
this.removeAttribute('required')
9187
}
9288
}
89+
90+
get csrfField(): string {
91+
return this.getAttribute('csrf-field') || 'authenticity_token'
92+
}
93+
94+
set csrfField(value: string) {
95+
this.setAttribute('csrf-field', value);
96+
}
9397
}
9498

9599
function setLoadingState(event: Event) {

0 commit comments

Comments
 (0)