<commit_before>class @MC.ContentGallery extends @MC.Base
  class Item
    constructor: (@el, @gallery) ->
      @embeddedPlayerWrapper = $('.embedded-video-player-wrapper', @el)
      @el.addClass('no-touch') unless Utils.isTouchDevice()

    stopVideo: ->
      @embeddedPlayerWrapper.data('player')?.stopVideo?()

  @autoInit: ->
    $('.component-content-gallery').each (i, el) => new @($(el))

  constructor: (@el) ->
    super

    @items  = []
    $('.component-content', @el).each (i, el) => @items.push(new Item($(el), @))

    @slider = $('[data-slick-carousel]', @el)
    @slider.attr('padding-gallery', true)
    @initSlider()

  initSlider: =>
    options =
      slide:          '.component-content'
      arrows:         true
      dots:           true
      slidesToShow:   1
      slidesToScroll: 1
      focusOnSelect:  true

    @slider.addClass('single-slide') if $('.component-content', @el).length == 1
    @slider.slick options

    @slider.on 'beforeChange', (ev, slick, currentSlide, nextSlide) =>
      if @items[currentSlide].embeddedPlayerWrapper.length
        @items[currentSlide].stopVideo()

  onResponsiveSizeChange: ->
    @slider.slick('slickGoTo', 0)<commit_msg>Content Gallery - Disable nav arrow on mobile<commit_after>class @MC.ContentGallery extends @MC.Base
  class Item
    constructor: (@el, @gallery) ->
      @embeddedPlayerWrapper = $('.embedded-video-player-wrapper', @el)
      @el.addClass('no-touch') unless Utils.isTouchDevice()

    stopVideo: ->
      @embeddedPlayerWrapper.data('player')?.stopVideo?()

  @autoInit: ->
    $('.component-content-gallery').each (i, el) => new @($(el))

  constructor: (@el) ->
    super

    @items  = []
    $('.component-content', @el).each (i, el) => @items.push(new Item($(el), @))

    @slider = $('[data-slick-carousel]', @el)
    @slider.attr('padding-gallery', true)
    @initSlider()

  initSlider: =>
    options =
      slide:          '.component-content'
      arrows:         true
      dots:           true
      slidesToShow:   1
      slidesToScroll: 1
      focusOnSelect:  true
      responsive: [
        {
          breakpoint: 768
          settings: {arrows: false}
        }]

    @slider.addClass('single-slide') if $('.component-content', @el).length == 1
    @slider.slick options

    @slider.on 'beforeChange', (ev, slick, currentSlide, nextSlide) =>
      if @items[currentSlide].embeddedPlayerWrapper.length
        @items[currentSlide].stopVideo()

  onResponsiveSizeChange: ->
    @slider.slick('slickGoTo', 0)
{'fraction_non_alphanumeric': 0.1656781336496639, 'fraction_numerical': 0.004349545274812179, 'mean_word_length': 2.8102409638554215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '261031', 'n_tokens_mistral': 839, 'n_tokens_neox': 789, 'n_words': 155}