﻿/*$(function () {
    // si assicura che l'excerpt delle featured news nel carousel non sfori lo spazio che ha a disposizione
    $("#carousel .item .articlepreview-featured").each(function () {
        // ottiene la massima altezza disponibile
        maxh = $(this).innerHeight() - $(this).find(".titles").outerHeight(true) - $(this).find(".author").outerHeight(true) - $(this).find(".morelink").outerHeight(true) - 10;

        el = $(this).find(".corpo");
        var text = el.html().trim();
        text = text.substr(0, text.indexOf("<a"));
        var t = $(this.cloneNode(true)).hide().css('position', 'absolute').css('overflow', 'visible').width(el.width()).height('auto');

        el.after(t);

        while (text.length > 0 && t.height() > maxh) {
            text = text.substr(0, text.length - 1);
            t.html(text + "...");
        }

        morelink = $(this).find(".morelink");
        el.html(t.html());
        el.append(morelink);
        t.remove();
    });
});*/


$(function () {
    // si assicura che l'excerpt delle featured news nel carousel non sfori lo spazio che ha a disposizione
    $("#carousel .item .articlepreview-featured").each(function () {
        // ottiene la massima altezza disponibile
        maxh = $(this).innerHeight() - $(this).find(".titles").outerHeight(true) - $(this).find(".author").outerHeight(true) - $(this).find(".morelink").outerHeight(true) - 10;

        corpo = $(this).find(".corpo");
        
        $(this).find(".corpo").addClass("multiline").css("overflow", "hidden").height(maxh).ellipsis();
    });

    $(".articlepreview-normal .titles h1 a").addClass("multiline").css("overflow", "hidden").ellipsis();
});
