request.js-like frappe.call extension to website.js request
This commit is contained in:
parent
a20dc7a533
commit
799ab249ab
1 changed files with 8 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue