<commit_before>(function ($, root, undefined) {
  
  $(function () {
    
    'use strict';

    //Function to the css rule
    function checkSize(){
      switch( $(window).width() > 992 )
      {
        case true:
          //Get template from localized data in function.php::223

          $('#posts-hero').html(template.tile);
          
          //Do magic based on screen size
          if( $('.container').width() >= 1140 )
          {
            // DOM ready, take it away
            $('.isotope').isotope({
              layoutMode: 'masonryHorizontal',
              itemSelector: '.item',
              resizable: false,
              //sortBy: 'random',
              masonryHorizontal: {
                rowHeight: 144,
                gutter: 30
              }
            });
            $('.js-flickity').flickity({
              // options
              freeScroll: false,
              contain: true,
              pageDots: false
            });
          } else {
            $('.isotope').isotope({
              layoutMode: 'masonryHorizontal',
              itemSelector: '.item',
              resizable: false,
              //sortBy: 'random',
              masonryHorizontal: {
                rowHeight: 111,
                gutter: 30
              }
            });
            $('.js-flickity').flickity({
              // options
              freeScroll: false,
              contain: true,
              pageDots: false
            });
          }
          break;
        default:
          //If below 970 loat carousel from localized data in function.php::223
          console.log('made it');
          $('#posts-hero').html(template.carousel);
      }
    }

    // run test on initial page load
    checkSize();

    // run test on resize of the window<commit_msg>add loaded flag and adjust breakpoint to 1200<commit_after>(function ($, root, undefined) {
  
  $(function () {
    
    'use strict';

    var isLoaded = false;

    //Function to the css rule
    function checkSize(){
      switch( $(window).width() > 992 )
      {
        case true:
          if(!isLoaded)
          {
            $('.js-flickity').flickity({
              // options
              freeScroll: false,
              contain: true,
              pageDots: false
            }).flickity('reloadCells');
          };

          //Get template from localized data in function.php::223
          $('#posts-hero').html(template.tile);
          
          //Do magic based on screen size
          if( $(window).width() >= 1200 )
          {
            
            // DOM ready, take it away
            $('.isotope').isotope({
              layoutMode: 'masonryHorizontal',
              itemSelector: '.item',
              resizable: false,
              //sortBy: 'random',
              masonryHorizontal: {
                rowHeight: 144,
                gutter: 30
              }
            });
            if(isLoaded)
            {
              $('.js-flickity').flickity({
                // options
                freeScroll: false,
                contain: true,
                pageDots: false
              }).flickity('reloadCells');
            }

          } else {
            $('.isotope').isotope({
              layoutMode: 'masonryHorizontal',
              itemSelector: '.item',
              resizable: false,
              //sortBy: 'random',
              masonryHorizontal: {
                rowHeight: 111,
                gutter: 30
              }
            });
            if(isLoaded)
            {
              $('.js-flickity').flickity({
                // options
                freeScroll: false,
                contain: true,
                pageDots: false
              }).flickity('reloadCells');
            }
          }
          break;
        default:
          //If below 970 loat carousel from localized data in function.php::223
          console.log('made it');
          $('#posts-hero').html(template.carousel);
      }
      (function(){
        isLoaded = true;
      })();
    }

    // run test on initial page load
    checkSize();

    // run test on resize of the window
{'fraction_non_alphanumeric': 0.11839577329490875, 'fraction_numerical': 0.013448607108549471, 'mean_word_length': 1.125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2069562', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1033, 'n_words': 254}