if not a category route remove body class

This commit is contained in:
Angus McLeod 2018-09-23 09:08:39 +10:00
parent c4c96046cd
commit a3636a5038
1 changed files with 3 additions and 2 deletions

View File

@ -13,12 +13,13 @@ createWidget('category-header-widget', {
tagName: 'span',
html(args) {
if (args.currentPath.toLowerCase().indexOf('category') === -1) return;
const controller = this.register.lookup('controller:navigation/category');
const category = controller.get("category");
if (category && category.donations_cause) {
if (args.currentPath.toLowerCase().indexOf('category') > -1 &&
category &&
category.donations_cause) {
$("body").addClass("donations-category");
let contents = [