ensure widget is hidden on non-category paths
This commit is contained in:
parent
b4fd0287ed
commit
b8cf45aa7f
|
@ -1,3 +1,3 @@
|
|||
{{#if siteSettings.discourse_donations_cause_category}}
|
||||
{{mount-widget widget="category-header-widget"}}
|
||||
{{mount-widget widget="category-header-widget" args=(hash currentPath=currentPath)}}
|
||||
{{/if}}
|
||||
|
|
|
@ -12,13 +12,15 @@ function donationDisplay(amount, type) {
|
|||
createWidget('category-header-widget', {
|
||||
tagName: 'span',
|
||||
|
||||
html() {
|
||||
html(args) {
|
||||
if (args.currentPath.toLowerCase().indexOf('category') === -1) return;
|
||||
|
||||
let category;
|
||||
|
||||
const controller = this.container.lookup('controller:navigation/category');
|
||||
category = controller.get("category");
|
||||
|
||||
if(category && category.donations_cause) {
|
||||
if (category && category.donations_cause) {
|
||||
$("body").addClass("donations-category");
|
||||
|
||||
let contents = [
|
||||
|
|
Loading…
Reference in New Issue