lato 0.1.61 → 0.1.62
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: da92b193a071f5710bad624118ba7af88a9fb443a0ea5ba203aecec0787872d8
|
4
|
+
data.tar.gz: 7e2b0a8fbaf7903179fa21730f5d69ba13bf687dd9fce82f49a129f4c3d442b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78567b7e9045585557ab8fc242c095fc3ef94213d33ecc03771e58c3ccfc5a5665b10bbef113ebe8f7eaf98bf9995b8a68e165cfd6644b7746d3c879752ab72b
|
7
|
+
data.tar.gz: 2ecdaebc1d3b61e58b219240b875c912868299c7acb9d9cf5b86d1e08f32c6d18b1048311e96edce12ec7e66140d9449d3143a60cb90ff68e2c8576efc1a8b56
|
@@ -6,42 +6,13 @@ export default class extends Controller {
|
|
6
6
|
'input'
|
7
7
|
]
|
8
8
|
|
9
|
-
|
10
|
-
* Stimulus
|
11
|
-
*/
|
12
|
-
|
13
|
-
connect() {
|
14
|
-
this.originalFormData = this.loadFormData()
|
15
|
-
this.disableSubmit()
|
16
|
-
}
|
9
|
+
// NOTE: This controller is free for be used in future form improvements.
|
17
10
|
|
18
11
|
/**
|
19
|
-
*
|
12
|
+
* Stimulus
|
20
13
|
*/
|
21
14
|
|
22
|
-
|
23
|
-
// if (!this.hasSubmitTarget) return
|
24
|
-
// this.submitTarget.setAttribute('disabled', true)
|
25
|
-
}
|
26
|
-
|
27
|
-
enableSubmit() {
|
28
|
-
// if (!this.hasSubmitTarget) return
|
29
|
-
// this.submitTarget.removeAttribute('disabled')
|
30
|
-
}
|
31
|
-
|
32
|
-
loadFormData() {
|
33
|
-
const formData = {}
|
34
|
-
|
35
|
-
this.inputTargets.forEach((input) => {
|
36
|
-
if (input.type == 'checkbox') {
|
37
|
-
formData[input.name] = input.checked
|
38
|
-
} else {
|
39
|
-
formData[input.name] = input.value
|
40
|
-
}
|
41
|
-
})
|
42
|
-
|
43
|
-
return formData
|
44
|
-
}
|
15
|
+
connect() {}
|
45
16
|
|
46
17
|
/**
|
47
18
|
* Actions
|
@@ -49,12 +20,5 @@ export default class extends Controller {
|
|
49
20
|
|
50
21
|
onInputChange(e) {
|
51
22
|
e.target.classList.remove('is-invalid')
|
52
|
-
|
53
|
-
const formData = this.loadFormData()
|
54
|
-
if (JSON.stringify(formData) != JSON.stringify(this.originalFormData)) {
|
55
|
-
this.enableSubmit()
|
56
|
-
} else {
|
57
|
-
this.disableSubmit()
|
58
|
-
}
|
59
23
|
}
|
60
24
|
}
|
data/lib/lato/version.rb
CHANGED