Subversion Repositories SmartDukaan

Rev

Rev 28142 | Rev 30252 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
29951 amit.gupta 1
$(function () {
2
    $(document).on('click', ".price-circular", function () {
3
        loadPriceCircular("main-content");
4
    });
28102 tejbeer 5
 
29951 amit.gupta 6
    $(document).on('click', ".partner-price-circular", function () {
28134 tejbeer 7
 
29951 amit.gupta 8
        bootbox.confirm({
9
            message: "<div class = 'disclosurehindata'> <img src='resources/images/disclosure.png' style='width:100%'> </div>"
10
            ,
11
            buttons: {
12
                confirm: {
13
                    label: 'I agree',
14
                    className: 'btn-success'
15
                },
16
                cancel: {
17
                    label: 'I disagree',
18
                    className: 'btn-danger'
19
                }
20
            },
21
            callback: function (result) {
22
                if (result == true) {
23
                    loadPartnerPriceCircular("main-content");
24
                }
25
            }
26
        });
28134 tejbeer 27
 
29951 amit.gupta 28
    });
28102 tejbeer 29
 
28142 tejbeer 30
 
29951 amit.gupta 31
    $(document).on('click', ".circular-request", function () {
32
        var brand = $(".criteria-item-brands").val();
33
        var partnerType = $("#partnerType").val();
34
        doGetAjaxRequestHandler(context + "/priceCircularByBrandAndPartnerType?brands=" + brand + "&partnerType=" +
35
            partnerType,
36
            function (response) {
37
                console.log(response)
38
                $('.circular-container').html(response);
39
            });
40
    });
28102 tejbeer 41
 
29951 amit.gupta 42
    $(document).on('click', ".submit-circular-request", function () {
43
        let brand = $("#brands").val();
44
        let priceCircularUrl = `${context}/priceCircularByBrand?brand=${brand}`;
45
        if (typeof partnerId == "number") {
46
            priceCircularUrl = `${priceCircularUrl}&fofoId=${partnerId}`;
47
        }
48
        doGetAjaxRequestHandler(priceCircularUrl,
49
            function (response) {
50
                console.log(response)
51
                $('.price-circular-container').html(response);
52
            });
53
    });
28102 tejbeer 54
 
55
 
56
});
57
 
58
function loadPriceCircular(domId) {
29951 amit.gupta 59
    doGetAjaxRequestHandler(context + "/priceCircular",
60
        function (response) {
61
            $('#' + domId).html(response);
62
        });
28102 tejbeer 63
}
64
 
65
function loadPartnerPriceCircular(domId) {
29951 amit.gupta 66
    doGetAjaxRequestHandler(context + "/partnerPriceCircular",
67
        function (response) {
68
            $('#' + domId).html(response);
69
        });
28102 tejbeer 70
}