hr-design-system-handlebars 0.47.7 → 0.47.8
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.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v0.47.8 (Tue Jun 14 2022)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- adds support for detect scroll initiated by user or browser [#241](https://github.com/mumprod/hr-design-system-handlebars/pull/241) ([@StefanVesper](https://github.com/StefanVesper))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- SonicSoulSurfer ([@StefanVesper](https://github.com/StefanVesper))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v0.47.7 (Mon Jun 13 2022)
|
|
2
14
|
|
|
3
15
|
#### 🐛 Bug Fix
|
|
@@ -32,6 +32,15 @@ document.addEventListener('alpine:init', () => {
|
|
|
32
32
|
init(){
|
|
33
33
|
let lastScrollTop = 0
|
|
34
34
|
let height = top.innerHeight
|
|
35
|
+
|
|
36
|
+
let userScroll = false;
|
|
37
|
+
window.userScroll = userScroll;
|
|
38
|
+
|
|
39
|
+
function mouseEvent(e) {
|
|
40
|
+
userScroll = true;
|
|
41
|
+
window.userScroll = true;
|
|
42
|
+
}
|
|
43
|
+
window.addEventListener('wheel', mouseEvent, false);
|
|
35
44
|
|
|
36
45
|
window.addEventListener('scroll', this.debounce( () => {
|
|
37
46
|
let winScroll = document.body.scrollTop || document.documentElement.scrollTop
|
|
@@ -42,8 +51,10 @@ document.addEventListener('alpine:init', () => {
|
|
|
42
51
|
//console.log('winscroll: '+winScroll+' height: '+height + ' percent: '+ this.percent)
|
|
43
52
|
this.$store.navIsVisible = !this.isNavHidden()
|
|
44
53
|
this.$store.subNavIsVisible = !this.isSubNavHidden()
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
|
|
55
|
+
//console.log('Scroll initiated by ' + (window.userScroll == true ? "user" : "browser"));
|
|
56
|
+
|
|
57
|
+
},50), {passive: true})
|
|
47
58
|
},
|
|
48
59
|
percent: 0,
|
|
49
60
|
scrollingDown: true,
|
|
@@ -69,10 +80,19 @@ document.addEventListener('alpine:init', () => {
|
|
|
69
80
|
return this.percent > 0
|
|
70
81
|
},
|
|
71
82
|
shouldSectionNavBeHidden() {
|
|
72
|
-
|
|
83
|
+
if(window.userScroll == true){
|
|
84
|
+
return this.percent > 50 && this.scrollingDown && this.$store.burgeropen == false && this.$screen('lg')
|
|
85
|
+
} else {
|
|
86
|
+
return this.percent > 50 && this.$store.burgeropen == false && this.$screen('lg')
|
|
87
|
+
}
|
|
88
|
+
|
|
73
89
|
},
|
|
74
90
|
shouldServiceNavBeHidden() {
|
|
75
|
-
|
|
91
|
+
if(window.userScroll == true) {
|
|
92
|
+
return (this.percent > 90 && !this.$screen('lg') && this.scrollingDown && this.$store.burgeropen == false)
|
|
93
|
+
} else {
|
|
94
|
+
return (this.percent > 90 && !this.$screen('lg') && this.$store.burgeropen == false)
|
|
95
|
+
}
|
|
76
96
|
},
|
|
77
97
|
shouldServiceIconsBeHidden() {
|
|
78
98
|
return (this.percent > 50 && !this.$screen('md') && this.$store.burgeropen == false && this.$store.serviceNavIsOpen == false && this.scrollingDown == true) || (this.percent > 50 && !this.$screen('md') && this.$store.burgeropen == false && this.$store.serviceNavIsOpen == false && this.scrollingDown == false)
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"repository": "https://github.com/szuelch/hr-design-system-handlebars",
|
|
9
|
-
"version": "0.47.
|
|
9
|
+
"version": "0.47.8",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
12
|
"storybook": "start-storybook -p 6006 public",
|
|
@@ -32,6 +32,15 @@ document.addEventListener('alpine:init', () => {
|
|
|
32
32
|
init(){
|
|
33
33
|
let lastScrollTop = 0
|
|
34
34
|
let height = top.innerHeight
|
|
35
|
+
|
|
36
|
+
let userScroll = false;
|
|
37
|
+
window.userScroll = userScroll;
|
|
38
|
+
|
|
39
|
+
function mouseEvent(e) {
|
|
40
|
+
userScroll = true;
|
|
41
|
+
window.userScroll = true;
|
|
42
|
+
}
|
|
43
|
+
window.addEventListener('wheel', mouseEvent, false);
|
|
35
44
|
|
|
36
45
|
window.addEventListener('scroll', this.debounce( () => {
|
|
37
46
|
let winScroll = document.body.scrollTop || document.documentElement.scrollTop
|
|
@@ -42,8 +51,10 @@ document.addEventListener('alpine:init', () => {
|
|
|
42
51
|
//console.log('winscroll: '+winScroll+' height: '+height + ' percent: '+ this.percent)
|
|
43
52
|
this.$store.navIsVisible = !this.isNavHidden()
|
|
44
53
|
this.$store.subNavIsVisible = !this.isSubNavHidden()
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
|
|
55
|
+
//console.log('Scroll initiated by ' + (window.userScroll == true ? "user" : "browser"));
|
|
56
|
+
|
|
57
|
+
},50), {passive: true})
|
|
47
58
|
},
|
|
48
59
|
percent: 0,
|
|
49
60
|
scrollingDown: true,
|
|
@@ -69,10 +80,19 @@ document.addEventListener('alpine:init', () => {
|
|
|
69
80
|
return this.percent > 0
|
|
70
81
|
},
|
|
71
82
|
shouldSectionNavBeHidden() {
|
|
72
|
-
|
|
83
|
+
if(window.userScroll == true){
|
|
84
|
+
return this.percent > 50 && this.scrollingDown && this.$store.burgeropen == false && this.$screen('lg')
|
|
85
|
+
} else {
|
|
86
|
+
return this.percent > 50 && this.$store.burgeropen == false && this.$screen('lg')
|
|
87
|
+
}
|
|
88
|
+
|
|
73
89
|
},
|
|
74
90
|
shouldServiceNavBeHidden() {
|
|
75
|
-
|
|
91
|
+
if(window.userScroll == true) {
|
|
92
|
+
return (this.percent > 90 && !this.$screen('lg') && this.scrollingDown && this.$store.burgeropen == false)
|
|
93
|
+
} else {
|
|
94
|
+
return (this.percent > 90 && !this.$screen('lg') && this.$store.burgeropen == false)
|
|
95
|
+
}
|
|
76
96
|
},
|
|
77
97
|
shouldServiceIconsBeHidden() {
|
|
78
98
|
return (this.percent > 50 && !this.$screen('md') && this.$store.burgeropen == false && this.$store.serviceNavIsOpen == false && this.scrollingDown == true) || (this.percent > 50 && !this.$screen('md') && this.$store.burgeropen == false && this.$store.serviceNavIsOpen == false && this.scrollingDown == false)
|