diff --git a/frontend/src/scripts/index.js b/frontend/src/scripts/index.js index bf31ba6..6155ba7 100644 --- a/frontend/src/scripts/index.js +++ b/frontend/src/scripts/index.js @@ -43,14 +43,6 @@ class Main extends Component { onHashChange(event){ this.setState({page: window.location.hash}) } - onViewChange(index){ - let new_index = (this.state.currentImage - 1 + index) % this.state.photos.length - if (new_index < 0){ - new_index += this.state.photos.length - } - this.setState({currentImage: new_index}) - this.carousel && this. carousel.setState({currentIndex: 1}) - } onSubmit(event){ event.preventDefault(); let form = document.getElementById("form"); @@ -84,25 +76,16 @@ class Main extends Component { width: photo.original_width, height: photo.original_height, }) - } - if (this.state.photos.length > 3){ - for(let i=this.state.currentImage-1; i<=this.state.currentImage+1; i++){ - let j = i; - if(j < 0){ - j += this.state.photos.length; - } - photos_carousel.push({'source': this.state.photos[j % this.state.photos.length].original}) - } - } - - this.carousel = this.state.photoIsOpen && this.onViewChange(v)}}/> - + photos_carousel.push({ + source: photo.original + }) + }; return (
{this.state.photoIsOpen && - {this.carousel} + } @@ -120,7 +103,7 @@ class Main extends Component { {this.state.page == "#gallery" &&
- +
} {this.state.page == "" &&