Skip to content

Commit

Permalink
Fixes issue #2297
Browse files Browse the repository at this point in the history
  • Loading branch information
andysellick committed Nov 26, 2021
1 parent 3a377fb commit d3df85a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/assets/javascripts/modules/sticky-element-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
StickyElementContainer.prototype.init = function () {
if (!this.stickyElement) return

window.onresize = this.onResize
window.onscroll = this.onScroll
window.onresize = this.onResize.bind(this)
window.onscroll = this.onScroll.bind(this)
setInterval(this.checkResize.bind(this), this.interval)
setInterval(this.checkScroll.bind(this), this.interval)
this.checkResize()
Expand Down Expand Up @@ -71,7 +71,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
StickyElementContainer.prototype.checkScroll = function () {
if (this.hasScrolled) {
this.hasScrolled = false
this.hasResized = true

this.windowVerticalPosition = this.getWindowPositions().scrollTop

Expand Down

0 comments on commit d3df85a

Please sign in to comment.