Skip to content

Commit

Permalink
Merge pull request #49 from Sardis93/main
Browse files Browse the repository at this point in the history
fix: Remove context from openy_calc_scroll behaviour.
  • Loading branch information
podarok authored Nov 6, 2023
2 parents 06d01f3 + 279e5b8 commit d489fb2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions openy_calc/js/openy_calc_submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
*/
Drupal.behaviors.openy_calc_scroll = {
attach: function (context, settings) {
$(once('openy-calc-scroll', '#membership-calc-wrapper', context))
.each(function () {
var divPosition = $(this).offset();
$('html, body').animate({scrollTop: divPosition.top - 100}, "slow");
once('openy-calc-scroll', '#membership-calc-wrapper').forEach((wrapper) => {
var divPosition = $(wrapper).offset();
$('html, body').animate({scrollTop: divPosition.top - 100}, "slow");
});
}
};
Expand Down

0 comments on commit d489fb2

Please sign in to comment.