Trigger xAPI events on top as well if inside ifra
parent
d6db07481e
commit
e981e7d605
|
@ -40,7 +40,7 @@ H5P.EventDispatcher = (function () {
|
||||||
if (thisArg === undefined) {
|
if (thisArg === undefined) {
|
||||||
thisArg = self;
|
thisArg = self;
|
||||||
}
|
}
|
||||||
if (!(listener instanceof Function)) {
|
if (typeof listener !== 'function') {
|
||||||
throw TypeError('listener must be a function');
|
throw TypeError('listener must be a function');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,10 @@ var H5P = H5P || {};
|
||||||
// Create object where external code may register and listen for H5P Events
|
// Create object where external code may register and listen for H5P Events
|
||||||
H5P.externalDispatcher = new H5P.EventDispatcher();
|
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
|
// EventDispatcher extensions
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue