Skip to content

Commit

Permalink
Fixed #554
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Aug 8, 2016
1 parent 9f348c7 commit c124fc0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/carousel/carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {TemplateWrapper} from '../common';
<span class="ui-carousel-button ui-carousel-prev-button fa fa-arrow-circle-left" (click)="onPrevNav()"
[ngClass]="{'ui-state-disabled':(page === 0 && !circular)}"></span>
<div *ngIf="displayPageLinks" class="ui-carousel-page-links">
<a href="#" class="ui-carousel-page-link fa fa-circle-o" *ngFor="let links of anchorPageLinks;let i=index" [ngClass]="{'fa-dot-circle-o':page===i}"></a>
<a href="#" (click)="setPageWithLink($event,i)" class="ui-carousel-page-link fa fa-circle-o" *ngFor="let links of anchorPageLinks;let i=index" [ngClass]="{'fa-dot-circle-o':page===i}"></a>
</div>
<select *ngIf="displayPageDropdown" class="ui-carousel-dropdown ui-widget ui-state-default ui-corner-left" [value]="page" (change)="onDropdownChange($event.target.value)">
<option *ngFor="let option of selectDropdownOptions" [value]="option" [selected]="value == option">{{option+1}}</option>
Expand Down Expand Up @@ -220,6 +220,11 @@ export class Carousel implements OnInit,AfterViewChecked,AfterViewInit,DoCheck,O
this.setPage(this.totalPages - 1);
}

setPageWithLink(event, p: number) {
this.setPage(p);
event.preventDefault();
}

setPage(p, enforce?: boolean) {
if(p !== this.page || enforce) {
this.page = p;
Expand Down

0 comments on commit c124fc0

Please sign in to comment.