mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 03:59:39 +08:00
Add title attribute to linked tag labels
This commit is contained in:
parent
8ba856df79
commit
7d38f0880e
@ -12,7 +12,7 @@ export default class DiscussionTaggedPost extends EventPost {
|
||||
var total = added.concat(removed);
|
||||
|
||||
var build = function(verb, tags, only) {
|
||||
return tags.length ? [verb, ' ', only && tags.length == 1 ? 'the ' : '', tagsLabel(tags)] : '';
|
||||
return tags.length ? [verb, ' ', only && tags.length == 1 ? 'the ' : '', tagsLabel(tags, {link: true})] : '';
|
||||
};
|
||||
|
||||
return super.view('tag', [
|
||||
|
@ -16,6 +16,10 @@ export default function tagsLabel(tag, attrs) {
|
||||
attrs.style.backgroundColor = attrs.style.color = color;
|
||||
attrs.className += ' colored';
|
||||
}
|
||||
|
||||
if (link) {
|
||||
attrs.title = tag.description() || '';
|
||||
}
|
||||
} else {
|
||||
attrs.className += ' untagged';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user