Skip to content

Commit

Permalink
Fix readystatechange listener to avoid conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Jun 7, 2020
1 parent 44eea1e commit 62ead8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/h5pxapikatchu-listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ var H5P = H5P || {};
/**
* Add xAPI listeners to all H5P instances that can trigger xAPI.
*/
document.onreadystatechange = function() {
document.addEventListener( 'readystatechange', function() {

// Add xAPI EventListener if H5P content is present
if ( 'interactive' === document.readyState ) {
Expand All @@ -88,5 +88,5 @@ var H5P = H5P || {};
console.warn( error );
}
}
};
});;
} () );

0 comments on commit 62ead8d

Please sign in to comment.