angular-carousel icon indicating copy to clipboard operation
angular-carousel copied to clipboard

rn-carousel-locked does not work when create slides with ng-repeat

Open milton-loayza-mojix-com opened this issue 9 years ago • 4 comments

When create slides dynamically using ng-repeat the rn-carousel-locked attribute does not work only works with static slides see http://jsfiddle.net/csyzd6xL/1/

milton-loayza-mojix-com avatar Jan 20 '15 22:01 milton-loayza-mojix-com

It doesn't work if the locked flag is always true, it works with a checkbox: http://jsfiddle.net/a2ke6grk/2/

andreicojea avatar Feb 06 '15 11:02 andreicojea

@milton-loayza-tierconnect-com, you can use $timeout as a workaround: http://jsfiddle.net/a2ke6grk/1/

andreicojea avatar Feb 06 '15 11:02 andreicojea

Thanks @andreicojea, for the suggestion.

milton-loayza-mojix-com avatar Feb 06 '15 13:02 milton-loayza-mojix-com

For me it works if I set pressed to false in swipeStart() if locked

function swipeStart(coords, event) {
    // console.log('swipeStart', coords, event);
    if (locked || currentSlides.length <= 1) {
        pressed = false; // <<<< HERE
        return;
    }
    updateContainerWidth();
    elX = iElement[0].querySelector('li').getBoundingClientRect().left;
    pressed = true;
    startX = coords.x;
    return false;
}

HriBB avatar Jun 13 '15 02:06 HriBB