Trigger xAPI events on top as well if inside ifra

d6
Svein-Tore Griff With 2015-02-18 10:59:47 +01:00
parent d6db07481e
commit e981e7d605
2 changed files with 5 additions and 1 deletions

View File

@ -40,7 +40,7 @@ H5P.EventDispatcher = (function () {
if (thisArg === undefined) {
thisArg = self;
}
if (!(listener instanceof Function)) {
if (typeof listener !== 'function') {
throw TypeError('listener must be a function');
}

View File

@ -3,6 +3,10 @@ var H5P = H5P || {};
// Create object where external code may register and listen for H5P Events
H5P.externalDispatcher = new H5P.EventDispatcher();
if (window.top !== window.self && window.top.H5P !== undefined && window.top.H5P.externalDispatcher !== undefined) {
H5P.externalDispatcher.on('xAPI', window.top.H5P.externalDispatcher.trigger);
}
// EventDispatcher extensions
/**