/**
 * This file is to add the active class in carousel indicators and carousel inner
 * of Slider Widget and Slider in Post Format.
 */
(function () {

    "use strict";

    // Add active class in carousel indicators
    var x = 0;
    var indicators = document.getElementsByClassName("carousel-indicators");

    while (indicators[x]) {
        var indicator = indicators[x];
        var li = indicator.getElementsByTagName("li")[0];
        li.classList.add("active");
        x++
    }

    //Add active class in carousel inner
    var i = 0;
    var carousels = document.getElementsByClassName("carousel-inner");

    while (carousels[i]) {
        var carousel = carousels[i];
        var item = carousel.getElementsByClassName("item")[0];
        item.classList.add("active");
        i++
    }

})();