Relay events to top window.
parent
c13e0a0a9a
commit
af8e9e8f30
|
@ -3,10 +3,6 @@ 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 (H5P.isFramed && H5P.externalEmbed === false) {
|
|
||||||
H5P.externalDispatcher.on('*', window.top.H5P.externalDispatcher.trigger);
|
|
||||||
}
|
|
||||||
|
|
||||||
// EventDispatcher extensions
|
// EventDispatcher extensions
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1747,12 +1747,16 @@ H5P.createTitle = function(rawTitle, maxLength) {
|
||||||
if (state !== undefined) {
|
if (state !== undefined) {
|
||||||
// Async is not used to prevent the request from being cancelled.
|
// Async is not used to prevent the request from being cancelled.
|
||||||
H5P.setUserData(instance.contentId, 'state', state, {deleteOnChange: true, async: false});
|
H5P.setUserData(instance.contentId, 'state', state, {deleteOnChange: true, async: false});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Relay events to top window.
|
||||||
|
if (H5P.isFramed && H5P.externalEmbed === false) {
|
||||||
|
H5P.externalDispatcher.on('*', window.top.H5P.externalDispatcher.trigger);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
})(H5P.jQuery);
|
})(H5P.jQuery);
|
||||||
|
|
Loading…
Reference in New Issue