Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

fixing autosilder on ng-repeat items #186

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

CosticaPuntaru
Copy link

adds scope.$emit('rnCarousel:CollectionUpdated', slidesCount); on repeat collection changes so other directive can listen to it
adds handle to rnCarousel:CollectionUpdated to rn-carousel-auto-slide to update the private count of slides
fixes #184

@petertellgren
Copy link

What is stopping this from getting merged in?

@revolunet
Copy link
Owner

just some time to review, rebase and merge, sorry :/ will dive into these days

@petertellgren
Copy link

great news but no need for apologies :). Just asking to see if I could help. keep up the good work

@CosticaPuntaru
Copy link
Author

refactoring to apply review comments

@petertellgren
Copy link

Anything I can do to help speed up the merge of this PR?

@mkhatib
Copy link

mkhatib commented Sep 11, 2014

Just as an FYI I've managed to fix this by moving the slideCount calculation into the increment function itself instead of globally. Not sure if this is a better solution than the one proposed in this pull just thought I'd share how I got this working.

  var increment = function () {
    var slidesCount = element.children().length;
    if (scope.carouselExposedIndex < slidesCount - 1) {
      scope.carouselExposedIndex =  scope.carouselExposedIndex + 1;
    } else {
      scope.carouselExposedIndex = 0;
    }
  };

Not sure how cheap/expensive the element.children().length to call on each increment, but this seems a very straight forward one-liner fix and worked for me.

@revolunet
Copy link
Owner

hi
i pushed an updated version that should make this easier

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auto slide doesn't work with ng-repat directive
5 participants