mirror of
https://github.com/flarum/framework.git
synced 2025-04-27 15:14:04 +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 total = added.concat(removed);
|
||||||
|
|
||||||
var build = function(verb, tags, only) {
|
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', [
|
return super.view('tag', [
|
||||||
|
@ -16,6 +16,10 @@ export default function tagsLabel(tag, attrs) {
|
|||||||
attrs.style.backgroundColor = attrs.style.color = color;
|
attrs.style.backgroundColor = attrs.style.color = color;
|
||||||
attrs.className += ' colored';
|
attrs.className += ' colored';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (link) {
|
||||||
|
attrs.title = tag.description() || '';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
attrs.className += ' untagged';
|
attrs.className += ' untagged';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user