Remove space characters from in-between list items

They were causing some weirdness with spacing between redraws.
This commit is contained in:
Toby Zerner 2016-05-28 09:38:30 +09:30
parent c3dfa3560a
commit a380424de4
4 changed files with 4 additions and 14 deletions

View File

@ -20965,15 +20965,12 @@ System.register('flarum/helpers/listItems', ['flarum/components/Separator', 'fla
item.attrs.key = item.attrs.key || item.itemName; item.attrs.key = item.attrs.key || item.itemName;
} }
var space = new String(' ');
space.attrs = { key: '_space_' + item.itemName };
return [isListItem ? item : m( return [isListItem ? item : m(
'li', 'li',
{ className: classList([item.itemName ? 'item-' + item.itemName : '', className, active ? 'active' : '']), { className: classList([item.itemName ? 'item-' + item.itemName : '', className, active ? 'active' : '']),
key: item.itemName }, key: item.itemName },
item item
), space]; )];
}); });
} }

View File

@ -28327,15 +28327,12 @@ System.register('flarum/helpers/listItems', ['flarum/components/Separator', 'fla
item.attrs.key = item.attrs.key || item.itemName; item.attrs.key = item.attrs.key || item.itemName;
} }
var space = new String(' ');
space.attrs = { key: '_space_' + item.itemName };
return [isListItem ? item : m( return [isListItem ? item : m(
'li', 'li',
{ className: classList([item.itemName ? 'item-' + item.itemName : '', className, active ? 'active' : '']), { className: classList([item.itemName ? 'item-' + item.itemName : '', className, active ? 'active' : '']),
key: item.itemName }, key: item.itemName },
item item
), space]; )];
}); });
} }

View File

@ -39,9 +39,6 @@ export default function listItems(items) {
item.attrs.key = item.attrs.key || item.itemName; item.attrs.key = item.attrs.key || item.itemName;
} }
const space = new String(' ');
space.attrs = {key: '_space_'+item.itemName};
return [ return [
isListItem isListItem
? item ? item
@ -52,8 +49,7 @@ export default function listItems(items) {
])} ])}
key={item.itemName}> key={item.itemName}>
{item} {item}
</li>, </li>
space
]; ];
}); });
} }

View File

@ -30,7 +30,7 @@
> li { > li {
display: inline; display: inline;
margin-right: 7px; margin-right: 10px;
} }
} }
} }