Skip to content

Commit

Permalink
Update: inview.js to use IntersectionObserver (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster authored Oct 1, 2024
1 parent aaca7c2 commit 315f0d1
Show file tree
Hide file tree
Showing 3 changed files with 284 additions and 544 deletions.
5 changes: 2 additions & 3 deletions js/views/contentObjectView.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,18 @@ export default class ContentObjectView extends AdaptView {
$(window).scrollTop(0);
}
Adapt.trigger(`${type}View:ready contentObjectView:ready view:ready`, this);
$.inview.unlock(`${type}View`);
const styleOptions = { opacity: 1 };
if (this.disableAnimation) {
this.$el.css(styleOptions);
$.inview();
$.inview.unlock(`${type}View`);
_.defer(() => {
Adapt.trigger(`${type}View:postReady contentObjectView:postReady view:postReady`, this);
});
} else {
this.$el.velocity(styleOptions, {
duration: 'fast',
complete: () => {
$.inview();
$.inview.unlock(`${type}View`);
Adapt.trigger(`${type}View:postReady contentObjectView:postReady view:postReady`, this);
}
});
Expand Down
1 change: 0 additions & 1 deletion js/views/notifyPopupView.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ export default class NotifyPopupView extends Backbone.View {
}

onOpened() {
$.inview();
this.hasOpened = true;
// Allows popup manager to control focus
a11y.popupOpened(this.$el);
Expand Down
Loading

0 comments on commit 315f0d1

Please sign in to comment.