{"size": 1291, "ext": "js", "max_stars_repo_path": "web/dev/js/product.js", "max_stars_repo_name": "iridhama/sales-finder", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "web/dev/js/product.js", "max_issues_repo_name": "iridhama/sales-finder", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "web/dev/js/product.js", "max_forks_repo_name": "iridhama/sales-finder", "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": 24.8269230769, "max_line_length": 62, "alphanum_fraction": 0.5096824167}

var ProductController = (function($) {
     return {
        createUpdate: function () {
            ProductController.CreateUpdate.init();
        }
    };
}(jQuery));

ProductController.CreateUpdate = (function ($) {
    var attachEvents = function () {
        initJs();
        chkboxFormSubmit();
        categoryFormSubmit();
        getRangeSliderValue()

    };
    
    var initJs = function () {
        console.log('i am loaded');
    };

    var getRangeSliderValue = function(){
        $(document).on('change','.discount-range', function(){
            $('#discount-span').text($(this).val());
            $('#product-search-form').submit();
        })
    }
    var categoryFormSubmit = function(){
        $(document).on('click','.category-list', function(){
            var elem = $(this);
            var category = elem.text();
            $('#productsearch-category').val(category.trim());
            $('#product-search-form').submit();
        })
    }

    var chkboxFormSubmit = function(){
        $(document).on('click','.store-chkbox', function(){
            $('#productsearch-category').val('');
            $('#product-search-form').submit();
        })
    }

    return {
        init: function () {
            attachEvents();
        }
    };
}(jQuery));

