mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 15:41:51 +08:00
Add span
to various labels so they can be targetted
This commit is contained in:
parent
70d0e175a2
commit
8e88bf019f
|
@ -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}}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user