Allow child tags in tile to wrap. fixes flarum/core#613

This commit is contained in:
Toby Zerner 2016-03-01 16:45:26 +10:30
parent d240d4c0ff
commit 287bdf10dd
3 changed files with 7 additions and 6 deletions

View File

@ -1017,7 +1017,7 @@ System.register('flarum/tags/components/TagsPage', ['flarum/Component', 'flarum/
'div', 'div',
{ className: 'TagTile-children' }, { className: 'TagTile-children' },
children.map(function (child) { children.map(function (child) {
return m( return [m(
'a', 'a',
{ href: app.route.tag(child), config: function (element, isInitialized) { { href: app.route.tag(child), config: function (element, isInitialized) {
if (isInitialized) return; if (isInitialized) return;
@ -1027,7 +1027,7 @@ System.register('flarum/tags/components/TagsPage', ['flarum/Component', 'flarum/
m.route.apply(this, arguments); m.route.apply(this, arguments);
} }, } },
child.name() child.name()
); ), ' '];
}) })
) : '' ) : ''
), ),

View File

@ -44,15 +44,16 @@ export default class TagsPage extends Component {
{children {children
? ( ? (
<div className="TagTile-children"> <div className="TagTile-children">
{children.map(child => {children.map(child => [
<a href={app.route.tag(child)} config={function(element, isInitialized) { <a href={app.route.tag(child)} config={function(element, isInitialized) {
if (isInitialized) return; if (isInitialized) return;
$(element).on('click', e => e.stopPropagation()); $(element).on('click', e => e.stopPropagation());
m.route.apply(this, arguments); m.route.apply(this, arguments);
}}> }}>
{child.name()} {child.name()}
</a> </a>,
)} ' '
])}
</div> </div>
) : ''} ) : ''}
</a> </a>

View File

@ -105,7 +105,7 @@
font-size: 12px; font-size: 12px;
a { a {
margin-right: 15px; margin-right: 10px;
} }
} }
.TagTile-lastDiscussion { .TagTile-lastDiscussion {