Relay events to top window.

semantics-font
Frode Petterson 2015-04-22 09:49:58 +02:00
parent c13e0a0a9a
commit af8e9e8f30
2 changed files with 5 additions and 5 deletions

View File

@ -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
/** /**

View File

@ -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);