作品打分连续点击不会多次提交

This commit is contained in:
cxt 2016-05-11 15:31:33 +08:00
parent 9bc8ccbb9e
commit fdefbf3795
1 changed files with 10 additions and 4 deletions

View File

@ -25,6 +25,7 @@
</li>
<% end%>
<script type="text/javascript">
var first_click_score = true;
function score_submit(id){
<% if !@is_teacher %>
if ($.trim($('#score_comment_'+id).val()) == "") {
@ -36,7 +37,8 @@
$('#score_notice_span_'+id).show();
$("#score_"+id).focus();
}
else {
else if(first_click_score) {
first_click_score = false;
$("#work_submit_"+id).parent().parent().submit();
$('#about_hwork_'+id).html('');
}
@ -52,13 +54,17 @@
}
});
}
else {
else if(first_click_score) {
first_click_score = false;
$("#work_submit_" + id).parent().parent().submit();
}
<% end %>
}
function submit_teacher_score(id){
$("#work_submit_"+id).parent().parent().submit();
hideModal();
if (first_click_score) {
first_click_score = false;
$("#work_submit_"+id).parent().parent().submit();
hideModal();
}
}
</script>