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

fixing autosilder on ng-repeat items#186

Open
CosticaPuntaru wants to merge 5 commits intorevolunet:masterfrom
CosticaPuntaru:master
Open

fixing autosilder on ng-repeat items#186
CosticaPuntaru wants to merge 5 commits intorevolunet:masterfrom
CosticaPuntaru:master

Conversation

@CosticaPuntaru
Copy link
Copy Markdown

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
Copy Markdown

What is stopping this from getting merged in?

@revolunet
Copy link
Copy Markdown
Owner

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

@petertellgren
Copy link
Copy Markdown

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

@CosticaPuntaru
Copy link
Copy Markdown
Author

refactoring to apply review comments

@petertellgren
Copy link
Copy Markdown

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

@mkhatib
Copy link
Copy Markdown

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
Copy Markdown
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