bullet_train-fields 1.7.21 → 1.7.23
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1966e7a0b35f9d33d71e51cd536f973c253f4912eb1efedba776b206635afaad
|
4
|
+
data.tar.gz: c626423751d8fd31ebdf4fd890ceeefbb0215ff8095c82c439bb3b4d3b3cdd89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '049d73c3da83d9f2254f15265867ef01fffa8184160fb754f87136b9fc4e238137fda6cc1a9564b3e51cd739fb911cb86be0459536caf8d4bbdd617a506eb7f0'
|
7
|
+
data.tar.gz: 1627b3dbda3d11d6586ca4ebd2336a22d911e4effb829fe03a28260ceec582361c7b3e18841f920586d1ab50da64bd718e069ce7e64556b99ef50f7027465b1a
|
@@ -21,7 +21,7 @@ export default class extends Controller {
|
|
21
21
|
this.disableFieldInputWhileRefreshing()
|
22
22
|
|
23
23
|
const frame = this.element
|
24
|
-
frame.src = this.constructNewUrlUpdatingField(field.name, field
|
24
|
+
frame.src = this.constructNewUrlUpdatingField(field.name, this.getValueForField(field))
|
25
25
|
}
|
26
26
|
|
27
27
|
finishFrameUpdate(event) {
|
@@ -32,7 +32,7 @@ export default class extends Controller {
|
|
32
32
|
}
|
33
33
|
|
34
34
|
constructNewUrlUpdatingField(fieldName, fieldValue) {
|
35
|
-
const url = new URL(
|
35
|
+
const url = new URL(window.location.href)
|
36
36
|
url.searchParams.set(fieldName, fieldValue)
|
37
37
|
|
38
38
|
return url.href
|
@@ -50,7 +50,7 @@ export default class extends Controller {
|
|
50
50
|
storeFieldValues() {
|
51
51
|
this.fieldTargets.forEach(field => {
|
52
52
|
let storeUpdate = {}
|
53
|
-
storeUpdate[field.name] = field
|
53
|
+
storeUpdate[field.name] = this.getValueForField(field)
|
54
54
|
this.valuesStoreValue = Object.assign(this.valuesStoreValue, storeUpdate)
|
55
55
|
})
|
56
56
|
}
|
@@ -59,10 +59,26 @@ export default class extends Controller {
|
|
59
59
|
this.fieldTargets.forEach(field => {
|
60
60
|
const storedValue = this.valuesStoreValue[field.name]
|
61
61
|
if (storedValue === undefined) { return }
|
62
|
-
field
|
62
|
+
this.setValueForField(field, storedValue)
|
63
63
|
field.dispatchEvent(new Event('change')) // ensures cascading effects, including super-select validating against valid options
|
64
64
|
})
|
65
65
|
|
66
66
|
this.valuesStoreValue = {}
|
67
67
|
}
|
68
|
+
|
69
|
+
getValueForField(field) {
|
70
|
+
if (field.type === "checkbox") {
|
71
|
+
return field.checked
|
72
|
+
}
|
73
|
+
|
74
|
+
return field.value
|
75
|
+
}
|
76
|
+
|
77
|
+
setValueForField(field, value) {
|
78
|
+
if (field.type === "checkbox") {
|
79
|
+
field.checked = value
|
80
|
+
}
|
81
|
+
|
82
|
+
field.value = value
|
83
|
+
}
|
68
84
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-fields
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|