Skip to content

Commit

Permalink
Fix dispose method on IntersectionObserver technique to reference thi…
Browse files Browse the repository at this point in the history
…s.element and prevent runtime errors during a dispose call. Reference: Issue #23
  • Loading branch information
ecammit committed Aug 15, 2023
1 parent 3c2bc36 commit be8b5c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions demo/vpaid/vpaid-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1619,8 +1619,8 @@ var IntersectionObserver = function (_BaseTechnique) {
key: 'dispose',
value: function dispose() {
if (this.observer) {
this.observer.unobserve(element);
this.observer.disconnect(element);
this.observer.unobserve(this.element);
this.observer.disconnect(this.element);
}
}

Expand Down
4 changes: 2 additions & 2 deletions dist/openvv.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/Measurement/MeasurementTechniques/IntersectionObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default class IntersectionObserver extends BaseTechnique {
*/
dispose() {
if(this.observer) {
this.observer.unobserve(element);
this.observer.disconnect(element);
this.observer.unobserve(this.element);
this.observer.disconnect(this.element);
}
}

Expand Down Expand Up @@ -106,4 +106,4 @@ export default class IntersectionObserver extends BaseTechnique {
}
}

}
}

0 comments on commit be8b5c2

Please sign in to comment.