2
0
mirror of https://github.com/frappe/books.git synced 2024-12-24 20:00:29 +00:00
books/client/view/index.js
2018-04-09 00:02:44 +05:30

16 lines
578 B
JavaScript

const BaseList = require('frappejs/client/view/list');
const BaseTree = require('frappejs/client/view/tree');
const BaseForm = require('frappejs/client/view/form');
const frappe = require('frappejs');
module.exports = {
getFormClass(doctype) {
return (frappe.views['Form'] && frappe.views['Form'][doctype]) || BaseForm;
},
getListClass(doctype) {
return (frappe.views['List'] && frappe.views['List'][doctype]) || BaseList;
},
getTreeClass(doctype) {
return (frappe.views['Tree'] && frappe.views['Tree'][doctype] || BaseTree);
}
}