request.js-like frappe.call extension to website.js request

This commit is contained in:
Achilles Rasquinha 2018-03-13 13:56:50 +05:30
parent a20dc7a533
commit 799ab249ab

View file

@ -35,6 +35,14 @@ $.extend(frappe, {
},
call: function(opts) {
// opts = {"method": "PYTHON MODULE STRING", "args": {}, "callback": function(r) {}}
if (typeof arguments[0]==='string') {
opts = {
method: arguments[0],
args: arguments[1],
callback: arguments[2]
}
}
frappe.prepare_call(opts);
if(opts.freeze) {
frappe.freeze();