Skip to content

Commit 6fa0d32

Browse files
Gargronhiyuki2578
authored andcommitted
Fix uncached media in web UI not being clickable (mastodon#11745)
1 parent 20b0603 commit 6fa0d32

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

app/javascript/mastodon/components/media_gallery.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class Item extends React.PureComponent {
159159
if (attachment.get('type') === 'unknown') {
160160
return (
161161
<div className={classNames('media-gallery__item', { standalone })} key={attachment.get('id')} style={{ left: left, top: top, right: right, bottom: bottom, width: `${width}%`, height: `${height}%` }}>
162-
<a className='media-gallery__item-thumbnail' href={attachment.get('remote_url')} target='_blank' style={{ cursor: 'pointer' }} title={attachment.get('description')}>
162+
<a className='media-gallery__item-thumbnail' href={attachment.get('remote_url') || attachment.get('url')} target='_blank' style={{ cursor: 'pointer' }} title={attachment.get('description')}>
163163
<canvas width={32} height={32} ref={this.setCanvasRef} className='media-gallery__preview' />
164164
</a>
165165
</div>
@@ -342,7 +342,7 @@ class MediaGallery extends React.PureComponent {
342342

343343
return (
344344
<div className='media-gallery' style={style} ref={this.handleRef}>
345-
<div className={classNames('spoiler-button', { 'spoiler-button--minified': visible && !uncached })}>
345+
<div className={classNames('spoiler-button', { 'spoiler-button--minified': visible && !uncached, 'spoiler-button--click-thru': uncached })}>
346346
{spoilerButton}
347347
</div>
348348

app/javascript/styles/mastodon/components.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3449,6 +3449,10 @@ a.status-card.compact:hover {
34493449
height: auto;
34503450
}
34513451

3452+
&--click-thru {
3453+
pointer-events: none;
3454+
}
3455+
34523456
&--hidden {
34533457
display: none;
34543458
}
@@ -3479,8 +3483,6 @@ a.status-card.compact:hover {
34793483
}
34803484

34813485
&:disabled {
3482-
cursor: not-allowed;
3483-
34843486
.spoiler-button__overlay__label {
34853487
background: rgba($base-overlay-background, 0.5);
34863488
}

0 commit comments

Comments
 (0)