about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-05-06 05:33:56 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-05-06 05:33:56 +0200
commitb2f5b1045fd84b692721bf44652d569d63d17657 (patch)
treeb2ca901fc02af4bc2622582f7f18e3d9f781ccfc
parent1eb14ef7740001e897d5f2d7976cbb643800f428 (diff)
Add description on hover in media gallery (#10713)
-rw-r--r--app/javascript/mastodon/features/account_gallery/components/media_item.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/account_gallery/components/media_item.js b/app/javascript/mastodon/features/account_gallery/components/media_item.js
index 5643e6449..f44e20939 100644
--- a/app/javascript/mastodon/features/account_gallery/components/media_item.js
+++ b/app/javascript/mastodon/features/account_gallery/components/media_item.js
@@ -88,6 +88,7 @@ export default class MediaItem extends ImmutablePureComponent {
     const width  = `${Math.floor((displayWidth - 4) / 3) - 4}px`;
     const height = width;
     const status = attachment.get('status');
+    const title = status.get('spoiler_text') || attachment.get('description');
 
     let thumbnail = '';
 
@@ -133,7 +134,7 @@ export default class MediaItem extends ImmutablePureComponent {
 
     return (
       <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 })} />
           {visible && thumbnail}
         </a>