3

For a lightning community ,I have a small component built ,that worked well before locker .

The code uses bootstrap ,jquery 2.2.0 and ltng:require tags

Here is the component code

<aura:component implements="forceCommunity:availableForAllPageTypes" controller="HomePageCmpController">
<ltng:require scripts="/resource/LightningComponentStyles/js/jquery-2.2.0.min.js,
                       /resource/LightningComponentStyles/js/bootstrap.min.js,
                       /resource/LightningComponentStyles/js/carousel.js"


              afterScriptsLoaded="{!c.afterScriptsLoaded}"/>
  <aura:attribute name="lstcarouselContents" type="HomePageCmpController.Carousel[]"/>
   <aura:handler name="init" value="{!this}" action="{!c.getCarouselFeed}" />

 </aura:component>

The Carousel.js has a self invoking function

$(document).ready(function() {
$("#Carousel").carousel({
    interval: 7e3
})
});
var clickEvent = !1;
$("#Carousel").on("click", ".-carousel-menu a", function() {
clickEvent = !0, $(".-carousel-menu li").removeClass("active"),    $(this).parent().addClass("active")
 }).on("slid.bs.carousel", function(e) {
   if (!clickEvent) {
       var a = $(".a-carousel-menu").children().length - 1,
        s = $(".a-carousel-menu li.active");
       s.removeClass("active").next().addClass("active");
       var c = parseInt(s.data("slide-to"));
       a == c && $(".a-carousel-menu li").first().addClass("active")
   }
   clickEvent = !1
});

I have also raised a case with case No - 13966262 so any help appreciated on this

1
  • I also have problems with using bootstrap.js - e.g. tooltip() function is not working. Jul 5 '16 at 15:00
1

Seems like with new Winter 17 updates to the locker service ,this works now .So the updates to locker have seemed to fix this .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.