add ctrl enter press to submit on modal
this adds the ability for a camper to press ctrl + enter to submit a challenge while the challenge completion modal is open
This commit is contained in:
@ -423,6 +423,14 @@ function showCompletion() {
|
|||||||
var didCompleteWith = $('#completed-with').val() || null;
|
var didCompleteWith = $('#completed-with').val() || null;
|
||||||
$('#complete-courseware-dialog').modal('show');
|
$('#complete-courseware-dialog').modal('show');
|
||||||
$('#complete-courseware-dialog .modal-header').click();
|
$('#complete-courseware-dialog .modal-header').click();
|
||||||
|
|
||||||
|
$('#complete-courseware-dialog').keyup(function(e) {
|
||||||
|
// ctrl + enter
|
||||||
|
if (e.ctrlKey && e.keyCode === 13) {
|
||||||
|
$('#submit-challenge').click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('#submit-challenge').click(function(e) {
|
$('#submit-challenge').click(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ block content
|
|||||||
.spacer
|
.spacer
|
||||||
.row
|
.row
|
||||||
if (user)
|
if (user)
|
||||||
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to next challenge
|
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to next challenge (Ctrl + enter)
|
||||||
|
|
||||||
if (user.progressTimestamps.length > 2)
|
if (user.progressTimestamps.length > 2)
|
||||||
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
|
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
|
||||||
|
@ -91,7 +91,7 @@ block content
|
|||||||
span.completion-icon.ion-checkmark-circled.text-primary
|
span.completion-icon.ion-checkmark-circled.text-primary
|
||||||
.spacer
|
.spacer
|
||||||
if(user)
|
if(user)
|
||||||
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to next challenge
|
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to next challenge (Ctrl + enter)
|
||||||
else
|
else
|
||||||
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
||||||
include ../partials/challenge-modals
|
include ../partials/challenge-modals
|
||||||
|
@ -87,7 +87,7 @@ block content
|
|||||||
.spacer
|
.spacer
|
||||||
.row
|
.row
|
||||||
if (user)
|
if (user)
|
||||||
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to next challenge
|
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to next challenge (Ctrl + enter)
|
||||||
if (user.progressTimestamps.length > 2)
|
if (user.progressTimestamps.length > 2)
|
||||||
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
|
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
|
||||||
i.fa.fa-twitter  
|
i.fa.fa-twitter  
|
||||||
|
Reference in New Issue
Block a user