get hotkey working in showVideo

This commit is contained in:
Michael Q Larson
2015-03-22 01:28:40 -07:00
parent d0a40dc202
commit 9633a2dbe0
2 changed files with 9 additions and 4 deletions

View File

@ -74,14 +74,14 @@ $(document).ready(function() {
completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash);
});
$('#completed-courseware').on('click', function() {
console.log('trying to show modal');
$('#complete-courseware-dialog').modal('show');
});
$('#complete-courseware-dialog').on('keypress', function(e) {
if (e.which === 13 || e === 13) {
$('#next-courseware-button').click();
if (e.ctrlKey && e.keyCode == 13) {
$('#next-courseware-button').click();
}
});

View File

@ -47,4 +47,9 @@ block content
h1 #{name}
script.
var challengeName = !{JSON.stringify(name)};
var passedCoursewareHash = !{JSON.stringify(coursewareHash)};
var passedCoursewareHash = !{JSON.stringify(coursewareHash)};
$('body').on('keypress', function(e) {
if (e.ctrlKey && e.keyCode == 13) {
$('#complete-courseware-dialog').modal('show');
}
});