@total_onion/onion-library 3.0.48 → 3.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- export default function modalformv3Js ( options = {} ) {
1
+ export default function modalformv3Js(options = {}) {
2
2
  try {
3
- const { block } = options;
3
+ const {block} = options;
4
4
 
5
5
  // form logic
6
6
  function validateFormFields(block) {
@@ -9,7 +9,9 @@ export default function modalformv3Js ( options = {} ) {
9
9
  );
10
10
 
11
11
  inputs.forEach((input) => {
12
- const wrapper = input.closest('.cdb_form_field, .cdb_form_gdpr_information, .cdb_form_privacypolicy_information');
12
+ const wrapper = input.closest(
13
+ '.cdb_form_field, .cdb_form_gdpr_information, .cdb_form_privacypolicy_information'
14
+ );
13
15
 
14
16
  if (!wrapper) return;
15
17
 
@@ -41,18 +43,17 @@ export default function modalformv3Js ( options = {} ) {
41
43
  });
42
44
  }
43
45
 
44
-
45
- const submit = block.querySelector(
46
- '.cdb-submit'
47
- );
48
-
46
+ const submit = block.querySelector('.cdb-submit');
47
+ if (!submit) {
48
+ console.error('could not find submit button');
49
+ return;
50
+ }
49
51
  submit.classList.add('cmpl-cta-style-11', 'cmpl-cta-animation-style-1');
50
52
 
51
53
  submit.addEventListener('click', (e) => {
52
54
  validateFormFields(block);
53
55
  });
54
-
55
- } catch ( error ) {
56
- console.error( error );
56
+ } catch (error) {
57
+ console.error(error);
57
58
  }
58
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@total_onion/onion-library",
3
- "version": "3.0.48",
3
+ "version": "3.0.49",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "scripts": {