/**
 * Script loaded for user.
 *
 */

$(function(){


    /**
     * = FEED
     */
    //COMMENT DELETE HOVERING
    $(".add").hover(
        function () { $(this).parent().prev('.hint-delete').toggleClass("hint-delete-show"); },
        function () { $(this).parent().prev('.hint-delete').toggleClass("hint-delete-show"); }
    );

    //FOLLOW
    //  follow a user
    //  we follow the user and remove follow icon from the list
    $('.add').click(function(event){
		event.preventDefault();
		$.getJSON( $(event.target).attr('href'),function(data){
                    var feedId = $(event.target).attr('rel');
                    $.jGrowl("You are now following " + $(event.target).parents().prev().find("li." + feedId).text());
                    $(event.target).parents().find("ul."+data.id).remove();

		});
    });



    // Scroll to top on pagination click
    $('.pagination').each(function()
    {
        $(this).click(function()
        {
            $('html, body').animate({scrollTop:400}, 'normal');
        });
    });




});
