Skip to content

Commit

Permalink
fix(module: carousel): fix carouselslide when set one item and vertic…
Browse files Browse the repository at this point in the history
…al:true, width not right (NG-ZORRO#86)
  • Loading branch information
Guoyuanqiang committed Oct 31, 2018
1 parent c03e6ac commit bb59fe7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions components/carousel/carousel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,13 @@ export class CarouselComponent implements AfterViewInit, OnDestroy {
this.slideHeight = nativeElement.querySelector('carouselslide').clientHeight;
this._currentSlideHeight = this.slideHeight * this.slideWidth;
this._currentSlideWidth = nativeElement.clientWidth;
this._rationWidth = this.vertical ? this._currentSlideHeight : this._currentSlideWidth * this.slideWidth;
this._rationWidth = this.vertical ? this._currentSlideWidth : this._currentSlideWidth * this.slideWidth;
this._spaceWidth = ((this.vertical ? this.slideHeight : this._currentSlideWidth) - this._rationWidth) / 2;
}

carouselInit(items) {
this.infinite = this.infinite || true;
this._nodeArr = items['_results'];
// this.dragging = this._nodeArr.length > 1 && this.dragging ? this.dragging : false;
this.dragging = this.dragging ? this.dragging : false;
if (this._nodeArr.length > 1) {
this._lastIndex = this._nodeArr.length - 1;
Expand Down

0 comments on commit bb59fe7

Please sign in to comment.