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

Force initial carouselIndex#312

Open
thenikso wants to merge 1 commit into
revolunet:masterfrom
thenikso:initial_index_fix
Open

Force initial carouselIndex#312
thenikso wants to merge 1 commit into
revolunet:masterfrom
thenikso:initial_index_fix

Conversation

@thenikso
Copy link
Copy Markdown

This issue is described in #296

The solution is a bit convoluted but the point is that the provided initial index was overridden because slides were not loaded yet.

@EAndreyF
Copy link
Copy Markdown

Please, merge this fix quickly. It's really need for me.

@revolunet
Copy link
Copy Markdown
Owner

@EAndreyF : did you try this PR ?

@EAndreyF
Copy link
Copy Markdown

No. Changes for me is in 488: currentSlides && currentSlides.length > 0 && newValue >= currentSlides.length or just currentSlides && currentSlides.length && newValue >= currentSlides.length

Because I initialize my slider without images. If this PR is hard to test, I could make simple PR for my changes.

@bloodlanser
Copy link
Copy Markdown

+1

@treyhoover
Copy link
Copy Markdown

+1 this solved my problem

@demyz
Copy link
Copy Markdown

demyz commented Jun 18, 2015

+1

1 similar comment
@jonyw4
Copy link
Copy Markdown

jonyw4 commented Nov 11, 2015

+1

@a627382
Copy link
Copy Markdown

a627382 commented Jun 13, 2017

@thenikso
This fix doesn't work.

<ul class="elements vehicleImg" rn-carousel-index="$ctrl.vehicleIndex" rn-carousel-controls rn-carousel rn-carousel-pause-on-hover>
    <li ng-repeat="vehicle in $ctrl.vehicles">
      <img ng-src="{{ $ctrl.getImage(vehicle) }}" onerror="this.src='img/photos/vehicule.gif'"/>
            {{$index}} should be {{$ctrl.vehicleIndex}}
    </li>
  </ul>

I define in the controller this.vehicleIndex = 2 but the $index keeps being initially set to 0:
index_not_forced

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.

8 participants