]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix uncached media in web UI not being clickable
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 3 Sep 2019 02:56:40 +0000 (04:56 +0200)
committerThibaut Girka <thib@sitedethib.com>
Thu, 5 Sep 2019 12:02:04 +0000 (14:02 +0200)
Port 34adc8784a3f165a4bd5719a067093f703f499e9 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/components/media_gallery.js
app/javascript/flavours/glitch/styles/components/index.scss

index f32f7ff36de5fd37226c0eedcfc178e6734401f8..28b369d09ccd386836c5c455a6af11e971810a54 100644 (file)
@@ -179,7 +179,7 @@ class Item extends React.PureComponent {
     if (attachment.get('type') === 'unknown') {
       return (
         <div className={classNames('media-gallery__item', { standalone })} key={attachment.get('id')} style={{ left: left, top: top, right: right, bottom: bottom, width: `${width}%`, height: `${height}%` }}>
-          <a className='media-gallery__item-thumbnail' href={attachment.get('remote_url')} target='_blank' style={{ cursor: 'pointer' }} title={attachment.get('description')}>
+          <a className='media-gallery__item-thumbnail' href={attachment.get('remote_url') || attachment.get('url')} target='_blank' style={{ cursor: 'pointer' }} title={attachment.get('description')}>
             <canvas width={32} height={32} ref={this.setCanvasRef} className='media-gallery__preview' />
           </a>
         </div>
@@ -372,7 +372,7 @@ export default class MediaGallery extends React.PureComponent {
 
     return (
       <div className={computedClass} style={style} ref={this.handleRef}>
-        <div className={classNames('spoiler-button', { 'spoiler-button--minified': visible && !uncached })}>
+        <div className={classNames('spoiler-button', { 'spoiler-button--minified': visible && !uncached, 'spoiler-button--click-thru': uncached })}>
           {spoilerButton}
           {visible && sensitive && (
             <span className='sensitive-marker'>
index 7af80dd74c07c334b8a6ee76ba43e2d16227938e..97c5255659c7417b318ff4f21dfd6144a92448f9 100644 (file)
     align-items: center;
   }
 
+  &--click-thru {
+    pointer-events: none;
+  }
+
   &--hidden {
     display: none;
   }
     }
 
     &:disabled {
-      cursor: not-allowed;
-
       .spoiler-button__overlay__label {
         background: rgba($base-overlay-background, 0.5);
       }