@mjhls/mjh-framework 1.0.604-hamMagazine-v8 → 1.0.604-hamMagazine-v9
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/dist/cjs/HamMagazine.js
CHANGED
|
@@ -108,8 +108,12 @@ var HamMagazine = function HamMagazine(props) {
|
|
|
108
108
|
React.useEffect(function () {
|
|
109
109
|
// handling the top mast component
|
|
110
110
|
var topNavHeight = document.querySelector('.top-nav-secondary') && document.querySelector('.top-nav-secondary').offsetHeight;
|
|
111
|
+
var mastHeadHeight = document.querySelector('.nav-brands') && document.querySelector('.nav-brands').offsetHeight;
|
|
112
|
+
var topNav = 0;
|
|
113
|
+
if (mastHeadHeight) topNav = topNav + mastHeadHeight;else if (topNavHeight) topNav = topNav + topNavHeight;
|
|
114
|
+
if (navRef.current.offsetHeight) topNav = topNav + navRef.current.offsetHeight;
|
|
111
115
|
// Setting the top of the search component based on the offset of navigation component.
|
|
112
|
-
searchRef.current.style.top =
|
|
116
|
+
searchRef.current.style.top = topNav + 1 + 'px';
|
|
113
117
|
document.addEventListener('scroll', trackScrolling);
|
|
114
118
|
return function () {
|
|
115
119
|
document.removeEventListener('scroll', trackScrolling);
|
package/dist/esm/HamMagazine.js
CHANGED
|
@@ -101,8 +101,12 @@ var HamMagazine = function HamMagazine(props) {
|
|
|
101
101
|
useEffect(function () {
|
|
102
102
|
// handling the top mast component
|
|
103
103
|
var topNavHeight = document.querySelector('.top-nav-secondary') && document.querySelector('.top-nav-secondary').offsetHeight;
|
|
104
|
+
var mastHeadHeight = document.querySelector('.nav-brands') && document.querySelector('.nav-brands').offsetHeight;
|
|
105
|
+
var topNav = 0;
|
|
106
|
+
if (mastHeadHeight) topNav = topNav + mastHeadHeight;else if (topNavHeight) topNav = topNav + topNavHeight;
|
|
107
|
+
if (navRef.current.offsetHeight) topNav = topNav + navRef.current.offsetHeight;
|
|
104
108
|
// Setting the top of the search component based on the offset of navigation component.
|
|
105
|
-
searchRef.current.style.top =
|
|
109
|
+
searchRef.current.style.top = topNav + 1 + 'px';
|
|
106
110
|
document.addEventListener('scroll', trackScrolling);
|
|
107
111
|
return function () {
|
|
108
112
|
document.removeEventListener('scroll', trackScrolling);
|