bullet_train-fields 1.8.4 → 1.8.5
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: f13952cec1ba63c8ad7fff90e281492b9002f13c69b8bf290bc73f2ccfd4f2cf
|
4
|
+
data.tar.gz: d0870184fb0f4fc34e34751c24e1f141ac42b65a74195227ef42e2fc5db1266c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ab3d5ad358e123764acca7e3dcac34301e4c59043d5ff9fc4d40d96b90b56f962368e2bb154d333294862e92d150992028ae47b8187a51728665d2ff38fda19
|
7
|
+
data.tar.gz: 4554dcdcf115f9e8afbaf9fe181a9e2679316c111b5445588a75d5915578ceb119a9550a242623fa927dd3f58e6011108ee4e2cb0e4817b49ccdf838cc831924
|
@@ -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
|
24
|
+
frame.src = this.constructNewUrlUpdatingField(field)
|
25
25
|
}
|
26
26
|
|
27
27
|
finishFrameUpdate(event) {
|
@@ -31,9 +31,19 @@ export default class extends Controller {
|
|
31
31
|
this.loadingValue = false
|
32
32
|
}
|
33
33
|
|
34
|
-
constructNewUrlUpdatingField(
|
34
|
+
constructNewUrlUpdatingField(field) {
|
35
35
|
const url = new URL(this.currentUrl)
|
36
|
-
|
36
|
+
const form = field.form
|
37
|
+
const formData = form ? new FormData(form) : {}
|
38
|
+
|
39
|
+
if ((field.type === "checkbox" || field.type === "select-multiple") && field.name.endsWith("[]")) {
|
40
|
+
url.searchParams.delete(field.name)
|
41
|
+
formData.getAll(field.name).forEach(value => {
|
42
|
+
url.searchParams.append(field.name, value)
|
43
|
+
})
|
44
|
+
} else {
|
45
|
+
url.searchParams.set(field.name, this.getValueForField(field))
|
46
|
+
}
|
37
47
|
|
38
48
|
return url.href
|
39
49
|
}
|
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.8.
|
4
|
+
version: 1.8.5
|
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-
|
11
|
+
date: 2024-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|