diff --git a/app/coffeescripts/jquery/fixDialogButtons.coffee b/app/coffeescripts/jquery/fixDialogButtons.coffee index f16fe7c5c46..71c699f1740 100644 --- a/app/coffeescripts/jquery/fixDialogButtons.coffee +++ b/app/coffeescripts/jquery/fixDialogButtons.coffee @@ -18,6 +18,11 @@ define [ if $button.is('.dialog_closer') $button.click preventDefault -> $dialog.dialog('close') + # make it so if you hit enter in the dialog, you submit the form + if $button.prop('type') is 'submit' && $button[0].form + $dialog.keypress (e) -> + $($button[0].form).submit() if e.keyCode is $.ui.keyCode.ENTER + return { text: $button.text() "data-text-while-loading": $button.data("textWhileLoading") diff --git a/app/views/shared/_new_course_form.html.erb b/app/views/shared/_new_course_form.html.erb index f6ba33ff59c..6de40da95cc 100644 --- a/app/views/shared/_new_course_form.html.erb +++ b/app/views/shared/_new_course_form.html.erb @@ -44,8 +44,11 @@
- - - + +
<% end %>