Browse Source

Prevent submitting empty code

pull/6/head
Pisces000221 7 years ago
parent
commit
3393ef213a
  1. 1
      views/problem.ejs

1
views/problem.ejs

@ -202,6 +202,7 @@ editor.setShowPrintMargin(false);
editor.renderer.updateFontSize(); editor.renderer.updateFontSize();
function submit_code() { function submit_code() {
if (!editor.getValue().trim()) return false;
$('#submit_code input[name=language]').val($('#languages-menu .item.active').data('value')); $('#submit_code input[name=language]').val($('#languages-menu .item.active').data('value'));
$('#submit_code input[name=code]').val(editor.getValue()); $('#submit_code input[name=code]').val(editor.getValue());
return true; return true;

Loading…
Cancel
Save