don't request another ajax call if one is pending (#9620)

This commit is contained in:
Manas Solanki
2017-07-10 12:12:16 +05:30
committed by Rushabh Mehta
parent 35ecab6a52
commit 77aa4762b8

View File

@@ -135,6 +135,7 @@ schools.StudentsEditor = Class.extend({
frappe.confirm(__("Do you want to update attendance?<br>Present: {0}\ frappe.confirm(__("Do you want to update attendance?<br>Present: {0}\
<br>Absent: {1}", [students_present.length, students_absent.length]), <br>Absent: {1}", [students_present.length, students_absent.length]),
function() { //ifyes function() { //ifyes
if(!frappe.request.ajax_count) {
frappe.call({ frappe.call({
method: "erpnext.schools.api.mark_attendance", method: "erpnext.schools.api.mark_attendance",
freeze: true, freeze: true,
@@ -151,6 +152,7 @@ schools.StudentsEditor = Class.extend({
frm.trigger("student_group"); frm.trigger("student_group");
} }
}); });
}
}, },
function() { //ifno function() { //ifno
$(me.wrapper.find(".btn-mark-att")).attr("disabled", false); $(me.wrapper.find(".btn-mark-att")).attr("disabled", false);