Skip to content

Commit

Permalink
Next and prev button will be visible when set in the options Carousel…
Browse files Browse the repository at this point in the history
… and directives attributes
  • Loading branch information
Vinicius Eloy committed May 4, 2017
1 parent de99a82 commit 245f4df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ui-carousel/controllers/carousel.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ angular.module('ui.carousel.controllers')
if (this.dots !== undefined) {
this.options.dots = this.dots;
}
if (this.isVisiblePrev !== undefined) {
this.options.isVisiblePrev = this.isVisiblePrev;
if (this.visiblePrev !== undefined) {
this.options.visiblePrev = this.visiblePrev;
}
if (this.isVisibleNext !== undefined) {
this.options.isVisibleNext = this.isVisibleNext;
if (this.visibleNext !== undefined) {
this.options.visibleNext = this.visibleNext;
}

// TODO write more options for fade mode
Expand Down Expand Up @@ -101,8 +101,8 @@ angular.module('ui.carousel.controllers')
this.slideStyle = {};

this.isVisibleDots = false;
this.isVisiblePrev = this.options.isVisiblePrev || false;
this.isVisibleNext = this.options.isVisibleNext || false;
this.isVisiblePrev = this.options.visiblePrev;
this.isVisibleNext = this.options.visibleNext;

this.isClickablePrev = false;
this.isClickableNext = false;
Expand Down
2 changes: 2 additions & 0 deletions src/ui-carousel/directives/carousel.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ angular.module('ui.carousel.directives')
arrows: '=?',
dots: '=?',
initialSlide: '=?',
visibleNext: '=?',
visiblePrev: '=?',

// Method
onBeforeChange: '&',
Expand Down
3 changes: 3 additions & 0 deletions src/ui-carousel/providers/carousel.provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ angular.module('ui.carousel.providers').provider('Carousel', function() {
slidesToScroll: 1,
speed: 500,

visiblePrev: false,
visibleNext: false,

// Not available right now
draggable: true,

Expand Down

0 comments on commit 245f4df

Please sign in to comment.