Add hotkey to go to next challenge/bonfire from completion modal, keep editor in focus on exiting completion modal, allow for courseware to theoretically work in production and development.

This commit is contained in:
Michael Q Larson
2015-02-06 16:55:48 -08:00
parent 319b537e5b
commit 4f9474bc3a
9 changed files with 54 additions and 194 deletions

View File

@@ -36,14 +36,6 @@ $(document).ready(function() {
}
});
$('#complete-courseware-dialog').keydown(function(e) {
if (e.ctrlKey && e.keyCode == 13) {
$('.next-courseware-button').click();
}
});
function completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash) {
$('#complete-bonfire-dialog').modal('show');
// Only post to server if there is an authenticated user
@@ -74,6 +66,13 @@ $(document).ready(function() {
});
$('#complete-bonfire-dialog').on('hidden.bs.modal', function() {
editor.focus();
});
$('#complete-courseware-dialog').on('hidden.bs.modal', function() {
editor.focus();
});
$('.next-courseware-button').on('click', function() {
if ($('.signup-btn-nav').length < 1) {
$.post(