fix: Add erpnext website theme import
This commit is contained in:
parent
22642a5f45
commit
8e99aaf605
@ -2,16 +2,13 @@
|
|||||||
// MIT License. See license.txt
|
// MIT License. See license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Website Theme', {
|
frappe.ui.form.on('Website Theme', {
|
||||||
apply_custom_theme(frm) {
|
validate(frm) {
|
||||||
let custom_theme = frm.doc.custom_theme;
|
let theme_scss = frm.doc.theme_scss;
|
||||||
custom_theme = custom_theme.split('\n');
|
if (theme_scss.includes('frappe/public/scss/website')
|
||||||
if (
|
&& !theme_scss.includes('erpnext/public/scss/website')
|
||||||
frm.doc.apply_custom_theme
|
|
||||||
&& custom_theme.length === 2
|
|
||||||
&& custom_theme[1].includes('frappe/public/scss/website')
|
|
||||||
) {
|
) {
|
||||||
frm.set_value('custom_theme',
|
frm.set_value('theme_scss',
|
||||||
`$primary: #7575ff;\n@import "frappe/public/scss/website";\n@import "erpnext/public/scss/website";`);
|
`${frm.doc.theme_scss}\n@import "erpnext/public/scss/website";`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user