[MFM] Resolve #4009

This commit is contained in:
syuilo
2019-01-27 19:32:35 +09:00
parent 311e67047d
commit 103fe8b91d
4 changed files with 45 additions and 10 deletions

View File

@ -128,9 +128,16 @@ export default Vue.component('misskey-flavored-markdown', {
motionCount++;
const isLong = sumTextsLength(token.children) > 5 || countNodesF(token.children) > 3;
const isMany = motionCount > 3;
const direction =
token.node.props.attr == 'left' ? 'reverse' :
token.node.props.attr == 'alternate' ? 'alternate' :
'normal';
const style = (this.$store.state.settings.disableAnimatedMfm || isLong || isMany)
? ''
: `animation: spin 1.5s linear infinite; animation-direction: ${direction};`;
return (createElement as any)('span', {
attrs: {
style: (this.$store.state.settings.disableAnimatedMfm || isLong || isMany) ? 'display: inline-block;' : 'display: inline-block; animation: spin 1.5s linear infinite;'
style: 'display: inline-block;' + style
},
}, genEl(token.children));
}