fix: Add erpnext website theme import

This commit is contained in:
Faris Ansari 2019-06-14 20:06:54 +05:30
parent 22642a5f45
commit 8e99aaf605

View File

@ -2,16 +2,13 @@
// MIT License. See license.txt
frappe.ui.form.on('Website Theme', {
apply_custom_theme(frm) {
let custom_theme = frm.doc.custom_theme;
custom_theme = custom_theme.split('\n');
if (
frm.doc.apply_custom_theme
&& custom_theme.length === 2
&& custom_theme[1].includes('frappe/public/scss/website')
validate(frm) {
let theme_scss = frm.doc.theme_scss;
if (theme_scss.includes('frappe/public/scss/website')
&& !theme_scss.includes('erpnext/public/scss/website')
) {
frm.set_value('custom_theme',
`$primary: #7575ff;\n@import "frappe/public/scss/website";\n@import "erpnext/public/scss/website";`);
frm.set_value('theme_scss',
`${frm.doc.theme_scss}\n@import "erpnext/public/scss/website";`);
}
}
});