mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-07 07:28:16 +00:00
Add back description on hover
This commit is contained in:
parent
8e221cd22b
commit
cbda1b8b66
|
@ -88,6 +88,7 @@ export default class MediaItem extends ImmutablePureComponent {
|
||||||
const width = `${Math.floor((displayWidth - 4) / 3) - 4}px`;
|
const width = `${Math.floor((displayWidth - 4) / 3) - 4}px`;
|
||||||
const height = width;
|
const height = width;
|
||||||
const status = attachment.get('status');
|
const status = attachment.get('status');
|
||||||
|
const title = status.get('spoiler_text') || attachment.get('description');
|
||||||
|
|
||||||
let thumbnail = '';
|
let thumbnail = '';
|
||||||
|
|
||||||
|
@ -132,7 +133,7 @@ export default class MediaItem extends ImmutablePureComponent {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='account-gallery__item' style={{ width, height }}>
|
<div className='account-gallery__item' style={{ width, height }}>
|
||||||
<a className='media-gallery__item-thumbnail' href={status.get('url')} target='_blank' onClick={this.handleClick}>
|
<a className='media-gallery__item-thumbnail' href={status.get('url')} target='_blank' onClick={this.handleClick} title={title}>
|
||||||
<canvas width={32} height={32} ref={this.setCanvasRef} className={classNames('media-gallery__preview', { 'media-gallery__preview--hidden': visible && loaded })} />
|
<canvas width={32} height={32} ref={this.setCanvasRef} className={classNames('media-gallery__preview', { 'media-gallery__preview--hidden': visible && loaded })} />
|
||||||
{visible && thumbnail}
|
{visible && thumbnail}
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in a new issue