{{ ucfunc("put_docready_start") }}

  var objWidget = jQuery('#{{uc_id}}');
  
  {% if grid_type == "masonry" %}
  
     {% if check_image_loaded == "true" %}objWidget.imagesLoaded( function() { {% endif %}
  
      var UETM_Grid = objWidget.find(".ue_testimonial_grid");
      
      var UETC_MasonryGrid = new MiniMasonry({
        container: '#{{uc_id}} .ue_testimonial_grid',
        gutter: {{gutter}},
        baseWidth: {{basewidth}},
        minify: {{minify}},
        surroundingGutter: {{surroundinggutter}},
        ultimateGutter:	{{ultimategutter}}, 
        direction: "{{direction}}"
      });

      function initializeTC_MasonryLayout() {
        UETC_MasonryGrid.layout();
      }
       
      initializeTC_MasonryLayout();

      window.onload = function () {
        initializeTC_MasonryLayout();
      };

      UETM_Grid.on("uc_ajax_refreshed",function(){
        initializeTC_MasonryLayout();
        setTimeout(initializeTC_MasonryLayout, 2000)
      });
  
    {% if check_image_loaded == "true" %} }); {% endif %}
   
  {% endif %}

{{ ucfunc("put_docready_end") }}