Skip to content

Commit

Permalink
FIX: don't display link elements if the list is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
vinothkannans committed Oct 15, 2019
1 parent e25f8ff commit d94ea2b
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions common/header.html
Expand Up @@ -70,17 +70,29 @@
},

generalLinks() {
return settings.links.split("|").map(l => {
const values = l.split(",");
return this.attach('link', { rawLabel: values[0], href: values[1] });
});
const links = settings.links;

if (links) {
return links.split("|").map(l => {
const values = l.split(",");
return this.attach('link', { rawLabel: values[0], href: values[1] });
});
} else {
return [];
}
},

iconLinks() {
return settings.icons.split("|").map(l => {
const values = l.split(",");
return this.attach('link', { icon: values[0], href: values[1] });
});
const icons = settings.icons;

if (icons) {
return icons.split("|").map(l => {
const values = l.split(",");
return this.attach('link', { icon: values[0], href: values[1] });
});
} else {
return [];
}
},

html(attrs, state) {
Expand Down

0 comments on commit d94ea2b

Please sign in to comment.