Compare commits
2 Commits
b6e2964f8e
...
fe41369754
| Author | SHA1 | Date | |
|---|---|---|---|
|
fe41369754
|
|||
|
1498c5a713
|
@@ -367,6 +367,7 @@ export default class PlaceDetails extends Component {
|
|||||||
<PlacePhotosCarousel
|
<PlacePhotosCarousel
|
||||||
@photos={{this.photos}}
|
@photos={{this.photos}}
|
||||||
@name={{this.name}}
|
@name={{this.name}}
|
||||||
|
@resetKey={{this.place.osmId}}
|
||||||
@scrollToEventId={{this.newlyUploadedPhotoId}}
|
@scrollToEventId={{this.newlyUploadedPhotoId}}
|
||||||
/>
|
/>
|
||||||
<h3>{{this.name}}</h3>
|
<h3>{{this.name}}</h3>
|
||||||
|
|||||||
@@ -29,6 +29,16 @@ export default class PlacePhotosCarousel extends Component {
|
|||||||
return !this.canScrollRight;
|
return !this.canScrollRight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastResetKey = null;
|
||||||
|
|
||||||
|
resetScrollPosition = modifier((element, [resetKey]) => {
|
||||||
|
if (resetKey !== undefined && resetKey !== this.lastResetKey) {
|
||||||
|
this.lastResetKey = resetKey;
|
||||||
|
element.scrollLeft = 0;
|
||||||
|
setTimeout(() => this.updateScrollState(), 50);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
scrollToNewPhoto = modifier((element, [eventId]) => {
|
scrollToNewPhoto = modifier((element, [eventId]) => {
|
||||||
if (eventId && eventId !== this.lastEventId) {
|
if (eventId && eventId !== this.lastEventId) {
|
||||||
this.lastEventId = eventId;
|
this.lastEventId = eventId;
|
||||||
@@ -99,6 +109,7 @@ export default class PlacePhotosCarousel extends Component {
|
|||||||
<div
|
<div
|
||||||
class="place-photos-carousel-track"
|
class="place-photos-carousel-track"
|
||||||
{{this.setupCarousel}}
|
{{this.setupCarousel}}
|
||||||
|
{{this.resetScrollPosition @resetKey}}
|
||||||
{{this.scrollToNewPhoto @scrollToEventId}}
|
{{this.scrollToNewPhoto @scrollToEventId}}
|
||||||
{{on "scroll" this.updateScrollState}}
|
{{on "scroll" this.updateScrollState}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -215,12 +215,12 @@ body {
|
|||||||
.dropzone {
|
.dropzone {
|
||||||
border: 2px dashed #ccc;
|
border: 2px dashed #ccc;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 2rem 1.5rem;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
margin: 1.5rem 0 1rem;
|
margin: 1.5rem 0 1rem;
|
||||||
background-color: rgb(255 255 255 / 2%);
|
background-color: rgb(255 255 255 / 2%);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
aspect-ratio: 4 / 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropzone.is-dragging {
|
.dropzone.is-dragging {
|
||||||
@@ -232,9 +232,12 @@ body {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #898989;
|
color: #898989;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropzone-label p {
|
.dropzone-label p {
|
||||||
|
|||||||
Reference in New Issue
Block a user