From a3636a5038ed285d91415f36999223eb3cec44c9 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Sun, 23 Sep 2018 09:08:39 +1000 Subject: [PATCH] if not a category route remove body class --- .../widgets/donations-category-header-widget.js.es6 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/widgets/donations-category-header-widget.js.es6 b/assets/javascripts/discourse/widgets/donations-category-header-widget.js.es6 index 5bd694e..020be93 100644 --- a/assets/javascripts/discourse/widgets/donations-category-header-widget.js.es6 +++ b/assets/javascripts/discourse/widgets/donations-category-header-widget.js.es6 @@ -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 = [