Commit 5d62a952 authored by Nicolas Borda's avatar Nicolas Borda
Browse files

Issue #3249236 by Idas, chakkche, ipwa, HEBL: OwlCarousel v2 for Drupal 8

parent 751ac4f5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
# owl
OWL Carousel for Drupal 8
OWL Carousel 2 for Drupal 8
+ Field formatter: See video: https://www.youtube.com/watch?v=PzBMJqkNHQ0
+ Views integrated see video: https://www.youtube.com/watch?v=kKps02rc3pE

# Credits
Daniele Monchiero [idas](https://www.drupal.org/u/idas)
Nicholas James [swim](https://www.drupal.org/u/swim)  
Anish Sheela [anisha](https://www.drupal.org/u/anisha)   
Nicolas Borda [ipwa](https://www.drupal.org/u/ipwa)  
+10 −32
Original line number Diff line number Diff line
/**
 * @file
 * OwlCarousel Drupal JS.
 */

(function ($, Drupal, drupalSettings) {
    'use strict';

    // @todo: Currently this is breaking JS in Drupal.
(function ($) {
  Drupal.behaviors.owl = {
    attach: function (context, settings) {
            // $('.owl-slider-wrapper', context).each(function () {
            //     var $this = $(this);
            //     var $this_settings = $.parseJSON($this.attr('data-settings'));
            //     $this.owlCarousel($this_settings);
            // });
      $('.owl-slider-wrapper', context).each(function () {
        var $this = $(this);
        var $this_settings = $.parseJSON($this.attr('data-settings'));
        $this.owlCarousel($this_settings);
      });
    }
  };

    /**
     * OwlCarousel views js.
     * @type {{attach: Drupal.behaviors.owlcarousel_views.attach}}
     */
    Drupal.behaviors.owlcarousel_views = {
        attach: function (context, settings) {

            // Declare the owlcarousel views settings object.
            var owlCarouselViews = drupalSettings.owlcarousel_views;
            // Loop the carousel object and output settings into our carousel.
            for (const item in owlCarouselViews) {
                var thisSettings = owlCarouselViews[item];
                $('.' + item).owlCarousel(thisSettings);
            }

        }
    }
})(jQuery, Drupal, drupalSettings);
})(jQuery);

lib/owl-carousel/AjaxLoader.gif

deleted100755 → 0
−1.48 KiB
Loading image diff...
+3.13 KiB
Loading image diff...

lib/owl-carousel/grabbing.png

deleted100755 → 0
−116 B
Loading image diff...
Loading