Add span to various labels so they can be targetted

This commit is contained in:
Robin Ward 2017-09-07 11:09:49 -04:00
parent 70d0e175a2
commit 8e88bf019f
3 changed files with 20 additions and 8 deletions

View File

@ -4,7 +4,7 @@
{{#if category.read_restricted}}
{{d-icon "lock"}}
{{/if}}
{{category.name}}
<span class='d-label'>{{category.name}}</span>
</a>
{{else}}
{{#if noSubcategories}}

View File

@ -37,9 +37,12 @@ createWidget('header-notifications', {
const unreadNotifications = user.get('unread_notifications');
if (!!unreadNotifications) {
contents.push(this.attach('link', { action: attrs.action,
className: 'badge-notification unread-notifications',
rawLabel: unreadNotifications }));
contents.push(this.attach('link', {
action: attrs.action,
className: 'badge-notification unread-notifications',
rawLabel: unreadNotifications,
omitSpan: true
}));
}
const unreadPMs = user.get('unread_private_messages');
@ -55,9 +58,12 @@ createWidget('header-notifications', {
}
};
contents.push(this.attach('link', { action: attrs.action,
className: 'badge-notification unread-private-messages',
rawLabel: unreadPMs }));
contents.push(this.attach('link', {
action: attrs.action,
className: 'badge-notification unread-private-messages',
rawLabel: unreadPMs,
omitSpan: true
}));
}
return contents;

View File

@ -54,7 +54,13 @@ export default createWidget('link', {
}
if (!attrs.hideLabel) {
result.push(this.label(attrs));
let label = this.label(attrs);
if (attrs.omitSpan) {
result.push(label);
} else {
result.push(h('span.d-label', label));
}
}
const currentUser = this.currentUser;