Fix portrait photos using thumb for full size variant
This commit is contained in:
@@ -33,6 +33,14 @@ export default class PhotoCarousel extends Component {
|
|||||||
return !this.canScrollRight;
|
return !this.canScrollRight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isGalleryMain() {
|
||||||
|
return this.args.variant === 'gallery-main';
|
||||||
|
}
|
||||||
|
|
||||||
|
get isGalleryThumbnails() {
|
||||||
|
return this.args.variant === 'gallery-thumbnails';
|
||||||
|
}
|
||||||
|
|
||||||
get variantClass() {
|
get variantClass() {
|
||||||
return this.args.variant || 'inline';
|
return this.args.variant || 'inline';
|
||||||
}
|
}
|
||||||
@@ -205,29 +213,47 @@ export default class PhotoCarousel extends Component {
|
|||||||
/>
|
/>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if photo.isLandscape}}
|
{{#if this.isGalleryMain}}
|
||||||
<picture>
|
<img
|
||||||
{{#if photo.thumbUrl}}
|
data-src={{photo.url}}
|
||||||
<source
|
class="place-header-photo
|
||||||
media="(max-width: 768px)"
|
{{if photo.isLandscape 'landscape' 'portrait'}}"
|
||||||
data-srcset={{photo.thumbUrl}}
|
alt={{@name}}
|
||||||
/>
|
{{fadeInImage photo.url}}
|
||||||
{{/if}}
|
/>
|
||||||
<img
|
{{else if this.isGalleryThumbnails}}
|
||||||
data-src={{photo.url}}
|
|
||||||
class="place-header-photo landscape"
|
|
||||||
alt={{@name}}
|
|
||||||
{{fadeInImage photo.url}}
|
|
||||||
/>
|
|
||||||
</picture>
|
|
||||||
{{else}}
|
|
||||||
{{! Portrait uses thumb everywhere if available }}
|
|
||||||
<img
|
<img
|
||||||
data-src={{if photo.thumbUrl photo.thumbUrl photo.url}}
|
data-src={{if photo.thumbUrl photo.thumbUrl photo.url}}
|
||||||
class="place-header-photo portrait"
|
class="place-header-photo
|
||||||
|
{{if photo.isLandscape 'landscape' 'portrait'}}"
|
||||||
alt={{@name}}
|
alt={{@name}}
|
||||||
{{fadeInImage (if photo.thumbUrl photo.thumbUrl photo.url)}}
|
{{fadeInImage (if photo.thumbUrl photo.thumbUrl photo.url)}}
|
||||||
/>
|
/>
|
||||||
|
{{else}}
|
||||||
|
{{#if photo.isLandscape}}
|
||||||
|
<picture>
|
||||||
|
{{#if photo.thumbUrl}}
|
||||||
|
<source
|
||||||
|
media="(max-width: 768px)"
|
||||||
|
data-srcset={{photo.thumbUrl}}
|
||||||
|
/>
|
||||||
|
{{/if}}
|
||||||
|
<img
|
||||||
|
data-src={{photo.url}}
|
||||||
|
class="place-header-photo landscape"
|
||||||
|
alt={{@name}}
|
||||||
|
{{fadeInImage photo.url}}
|
||||||
|
/>
|
||||||
|
</picture>
|
||||||
|
{{else}}
|
||||||
|
{{! Portrait uses thumb everywhere if available }}
|
||||||
|
<img
|
||||||
|
data-src={{if photo.thumbUrl photo.thumbUrl photo.url}}
|
||||||
|
class="place-header-photo portrait"
|
||||||
|
alt={{@name}}
|
||||||
|
{{fadeInImage (if photo.thumbUrl photo.thumbUrl photo.url)}}
|
||||||
|
/>
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export default class PhotoGallery extends Component {
|
|||||||
class="dropdown-item"
|
class="dropdown-item"
|
||||||
type="button"
|
type="button"
|
||||||
{{on "click" (fn this.copyEventId closeMenu)}}
|
{{on "click" (fn this.copyEventId closeMenu)}}
|
||||||
>Copy Nostr Event ID</button>
|
>Copy Photo Event ID</button>
|
||||||
<button
|
<button
|
||||||
class="dropdown-item"
|
class="dropdown-item"
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
Reference in New Issue
Block a user