Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRAK-1446 wrap handleLoad in try/catch to prevent load breakage #27

Merged
merged 1 commit into from Oct 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/js/read.js
Expand Up @@ -808,11 +808,16 @@
this.reactivate();
},
this.handleLoad = () => {
this.getScannableTargets(this.readJSConfig.el);
this.domNode = document.querySelector(this.readJSConfig.el);
this.setTimeInViewThreshold();
this.domNode.addEventListener("click", this.handleClick);
this.visibleScannableTargets(this.scannableTargets);
try {
this.getScannableTargets(this.readJSConfig.el);
this.domNode = document.querySelector(this.readJSConfig.el);
this.setTimeInViewThreshold();
this.domNode.addEventListener("click", this.handleClick);
this.visibleScannableTargets(this.scannableTargets);
} catch (err) {
this.console(err);
return false;
}
},
this.setTimeInViewThreshold = () => {

Expand Down