@total_onion/onion-library 1.0.75 → 1.0.76

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,20 +1,34 @@
1
- export default function formselectionv3Js ( options = {} ) {
1
+ export default function formselectionv3Js(options = {}) {
2
2
  try {
3
3
  const { block } = options;
4
4
 
5
5
  // modal logic
6
+ const siteHeader = document.querySelector('.site-header-block');
7
+
6
8
  const formContainer = block.querySelector('.form-selection-v3__container-modal');
7
9
  const openModal = block.querySelector('.form-selection-v3__modal-open');
8
10
  const closeModal = block.querySelector('.form-selection-v3__modal-close');
9
-
10
11
 
11
- if (formContainer && openModal ) {
12
+
13
+ document.body.appendChild(formContainer);
14
+
15
+
16
+ const headerHeight = () => {
17
+ const headerHeight = siteHeader.offsetHeight;
18
+ return headerHeight;
19
+ }
20
+
21
+ if (formContainer && openModal) {
12
22
  openModal.addEventListener('click', function (e) {
13
23
  e.preventDefault();
24
+ headerHeight();
14
25
  document.documentElement.classList.add('lock-position');
15
26
  formContainer.style.display = 'block';
27
+ formContainer.style.top = headerHeight() + 'px';
28
+ siteHeader.style.pointerEvents = 'none'
16
29
  });
17
30
  closeModal.addEventListener('click', function (e) {
31
+ siteHeader.style.pointerEvents = 'all'
18
32
  document.documentElement.classList.remove('lock-position');
19
33
  e.preventDefault();
20
34
  formContainer.style.display = 'none';
@@ -72,7 +86,7 @@ export default function formselectionv3Js ( options = {} ) {
72
86
  validateFormFields(block);
73
87
  });
74
88
 
75
- } catch ( error ) {
76
- console.error( error );
89
+ } catch (error) {
90
+ console.error(error);
77
91
  }
78
92
  }
@@ -10,15 +10,10 @@
10
10
  display: none;
11
11
  position: fixed;
12
12
  left: 0;
13
- top: var(--global-site-header-height);
14
- // top: 74px;
15
13
  width: 100vw;
16
14
  height: calc(100vh - 103px);
17
15
  z-index: 9998;
18
16
  background-color: rgba(0, 0, 0, 0.4);
19
- @include core-mixins-v3.device(breakpoints.$tabPortrait) {
20
- top: 103px;
21
- }
22
17
  }
23
18
 
24
19
  &__inner {
@@ -29,6 +24,7 @@
29
24
  }
30
25
 
31
26
  &__modal-open {
27
+ cursor: pointer;
32
28
  &--icon {
33
29
  appearance: none;
34
30
  border: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@total_onion/onion-library",
3
- "version": "1.0.75",
3
+ "version": "1.0.76",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "scripts": {