@@ -103,6 +103,8 @@ class StickyHeader {
103
103
if ( this . _masthead ) {
104
104
this . _masthead . setAttribute ( 'with-banner' , '' ) ;
105
105
}
106
+
107
+ this . _calculateCumulativeHeight ( ) ;
106
108
}
107
109
}
108
110
@@ -121,12 +123,14 @@ class StickyHeader {
121
123
this . _leadspaceWithSearchStickyThreshold =
122
124
parseInt ( window . getComputedStyle ( leadspaceSearchBar ) . paddingBottom ) -
123
125
16 ;
126
+ this . _calculateCumulativeHeight ( ) ;
124
127
}
125
128
}
126
129
127
130
set localeModal ( component ) {
128
131
if ( this . _validateComponent ( component , `${ ddsPrefix } -locale-modal` ) ) {
129
132
this . _localeModal = component ;
133
+ this . _calculateCumulativeHeight ( ) ;
130
134
}
131
135
}
132
136
@@ -139,6 +143,7 @@ class StickyHeader {
139
143
`.${ prefix } --masthead__l0`
140
144
) ;
141
145
this . _mastheadL1 = component . querySelector ( `${ ddsPrefix } -masthead-l1` ) ;
146
+ this . _calculateCumulativeHeight ( ) ;
142
147
}
143
148
}
144
149
@@ -147,6 +152,7 @@ class StickyHeader {
147
152
this . _tableOfContents = component ;
148
153
this . _tableOfContentsStickyUpdate ( ) ;
149
154
this . _resizeObserver . observe ( this . _tableOfContents ) ;
155
+ this . _calculateCumulativeHeight ( ) ;
150
156
}
151
157
}
152
158
@@ -156,7 +162,7 @@ class StickyHeader {
156
162
_throttledHandler ( ) {
157
163
if ( ! this . _throttled ) {
158
164
this . _throttled = true ;
159
- this . _handleScroll ( ) ;
165
+ this . _calculateCumulativeHeight ( ) ;
160
166
161
167
setTimeout ( ( ) => {
162
168
this . _throttled = false ;
@@ -188,7 +194,7 @@ class StickyHeader {
188
194
tocInner . style . top = `${ masthead . offsetHeight } px` ;
189
195
}
190
196
}
191
- this . _handleScroll ( ) ;
197
+ this . _calculateCumulativeHeight ( ) ;
192
198
}
193
199
194
200
if ( leadspaceSearchBar ) {
@@ -198,7 +204,7 @@ class StickyHeader {
198
204
}
199
205
}
200
206
201
- _handleScroll ( ) {
207
+ _calculateCumulativeHeight ( ) {
202
208
const {
203
209
_lastScrollPosition : oldY ,
204
210
_banner : banner ,
0 commit comments