From 8e99aaf6050afdf258343397c5e70109e89b56ea Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 14 Jun 2019 20:06:54 +0530 Subject: [PATCH] fix: Add erpnext website theme import --- erpnext/public/js/website_theme.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/erpnext/public/js/website_theme.js b/erpnext/public/js/website_theme.js index 6c7edfa655..84de2f5b51 100644 --- a/erpnext/public/js/website_theme.js +++ b/erpnext/public/js/website_theme.js @@ -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";`); } } });