Skip to content

Commit

Permalink
FIX wrong fromid, log error and continue
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasKulhanek committed Nov 13, 2020
1 parent 5c318f5 commit 6fbb6d1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/elements/animate-adobe.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ export class AnimateAdobe {
*/
bind() {
if (this.fromid) {
document.getElementById(this.fromid).addEventListener('animatestart', this.startAllAnimation);
document.getElementById(this.fromid).addEventListener('animatestop', this.stopAllAnimation);
document.getElementById(this.fromid).addEventListener('fmidata', this.handleValueChange);
document.getElementById(this.fromid).addEventListener('fmistart', this.enableAnimation);
document.getElementById(this.fromid).addEventListener('fmistop', this.disableAnimation);
let fromel = document.getElementById(this.fromid);
if (fromel) {
fromel.addEventListener('animatestart', this.startAllAnimation);
fromel.addEventListener('animatestop', this.stopAllAnimation);
fromel.addEventListener('fmidata', this.handleValueChange);
fromel.addEventListener('fmistart', this.enableAnimation);
fromel.addEventListener('fmistop', this.disableAnimation);
} else {
console.error('adobe-animate component cannot find control element with id:', this.fromid);
}
}
}
attached() {
Expand Down

0 comments on commit 6fbb6d1

Please sign in to comment.