Add title attribute to linked tag labels

This commit is contained in:
Toby Zerner 2015-06-26 12:22:39 +09:30
parent 8ba856df79
commit 7d38f0880e
2 changed files with 5 additions and 1 deletions

View File

@ -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', [

View File

@ -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';
}