Skip to content

Commit

Permalink
Fix: apply body padding on init, not on scroll [TMZ-177](#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
mserino authored Nov 25, 2024
1 parent 39cf012 commit 06c5582
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/template-parts/assets/js/hello-plus-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class elementorHelloPlusHeaderHandler {
}

onInit() {
const { none, no } = this.settings.constants;
const { none, no, always, scrollUp } = this.settings.constants;

this.handleAriaAttributesMenu();
this.handleAriaAttributesDropdown();
Expand All @@ -73,6 +73,10 @@ class elementorHelloPlusHeaderHandler {
if ( none === this.getDataScrollBehavior() && no === this.getBehaviorFloat() ) {
this.setupInnerContainer();
}

if ( scrollUp === this.getDataScrollBehavior() || always === this.getDataScrollBehavior() ) {
this.applyBodyPadding();
}
}

getBehaviorFloat() {
Expand Down Expand Up @@ -100,10 +104,6 @@ class elementorHelloPlusHeaderHandler {
if ( scrollUp === this.getDataScrollBehavior() || always === this.getDataScrollBehavior() ) {
this.handleScrollDown( this.getDataScrollBehavior() );
}

if ( always === this.getDataScrollBehavior() ) {
this.applyBodyPadding();
}
}

handleOffsetTop() {
Expand Down

0 comments on commit 06c5582

Please sign in to comment.