Merge remote-tracking branch 'origin/release' into release

pull/22/head
Thomas Marstrander 2016-06-07 14:32:12 +02:00
commit 8bd9e9c2db
1 changed files with 7 additions and 5 deletions

View File

@ -122,13 +122,15 @@ H5P.init = function (target) {
delete contentData.contentUserData;
var dialog = new H5P.Dialog('content-user-data-reset', 'Data Reset', '<p>' + H5P.t('contentChanged') + '</p><p>' + H5P.t('startingOver') + '</p><div class="h5p-dialog-ok-button" tabIndex="0" role="button">OK</div>', $container);
H5P.jQuery(dialog).on('dialog-opened', function (event, $dialog) {
$dialog.find('.h5p-dialog-ok-button').click(function () {
dialog.close();
}).keypress(function (event) {
if (event.which === 32) {
var closeDialog = function (event) {
if (event.type === 'click' || event.which === 32) {
dialog.close();
H5P.deleteUserData(contentId, 'state', 0);
}
});
};
$dialog.find('.h5p-dialog-ok-button').click(closeDialog).keypress(closeDialog);
});
dialog.open();
}