{"size": 1543, "ext": "js", "max_stars_repo_path": "src/AppBundle/Resources/public/js/product.js", "max_stars_repo_name": "abul-abul/building-material", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/AppBundle/Resources/public/js/product.js", "max_issues_repo_name": "abul-abul/building-material", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/AppBundle/Resources/public/js/product.js", "max_forks_repo_name": "abul-abul/building-material", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.2549019608, "max_line_length": 80, "alphanum_fraction": 0.4296824368}
$(document).ready(function () {
    var debug = $('body').data('debug');
    var prefix;
    if(debug){
        prefix = '/app_dev.php';
    }
    else{
        prefix = '';
    }

    $('.product_modal_view').click(function () {
        var id = $(this).attr('data-id');
        var image = $(this).attr('data-image')
        // $('.large_silder_product').html(' ');

        // $('.small_silder_product').html(' ')
        $.ajax({
            type: 'POST',
            url: prefix+'/one-product',
            data: {id:id},
            success:function (data) {

                imgHtml = '<img src='+image+'>'
                $('.pro-large-img').html(imgHtml)
                console.log(data)
                html=''
                html1=''
                $('.product_modal_title').text(data.name)
                if(data.rebate == null){
                    $('.product_modal_price').text(data.price)
                }else{
                    $('.product_modal_price').text(data.rebate)
                }

                $('.product_modal_desc').text(data.description)

                $.each( data.image, function( i, val ){
                    html+='<div class="pro-large-img"><img src='+val+'></div>'
                    html1+=' <div class="pro-nav-thumb"><img src='+val+'></div>'
                });
                // console.log(html)
                // console.log(html1)
                // $('.large_silder_product').html(html)
                // $('.small_silder_product').html(html1)

            }
        })
    })


})