joeyd
7/14/2016 - 4:07 PM

gistfile1.txt

<script>
eds1_8(function ($) {
    $('.edn_isotopeLayout > div').isotope('destroy');

    $('div.DnnModule-EasyDNNnews').first().addClass('first');
    var $articleListContainer = $('div.DnnModule-EasyDNNnews.first .edn_isotopeLayout > div'),
        imageLoadedKey = 'imageLoaded';

    var requiredClasses = 'article multi_layout two_collumn big edn_articleWrapper';
    var firstCatTitle= $('div.DnnModule-EasyDNNnews.first .edn_isotopeLayout').siblings('h2');

    $articleListContainer.prepend('<h2 class="'+requiredClasses+'">'+firstCatTitle.text()+'</h2>');

    firstCatTitle.remove();

    $('.news:not(.first .news)').each(function(){
        $('div.DnnModule-EasyDNNnews.first .edn_isotopeLayout > div').append('<h2 class="article multi_layout two_collumn big edn_articleWrapper">'+$(this).children().children('h2').text()+'</h2>');
        $('div.DnnModule-EasyDNNnews.first .edn_isotopeLayout > div').append( $(this).children().children('.edn_isotopeLayout').children('div').html() );
        //$(this).remove();
    });

    $('div.DnnModule-EasyDNNnews:not(.first)').remove();

$articleListContainer
    .isotope({
        itemSelector: '.edn_articleWrapper',
        sortBy: 'original-order',
        masonry: {
            columnWidth: '.grid-sizer',
            gutter: '.gutter-sizer',
            percentPosition: true
        }
    })
    .find('img').imagesLoaded()
        .progress(function (instance, image) {
            var $img = $(image.img);

            if ($img.data(imageLoadedKey))
                return;

            $img.data(imageLoadedKey, true);

            $articleListContainer.isotope('layout');
        });
});
</script>