Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

$(function () {
    $(document).on('click', '.toggle-price-drop-detail', function () {
        $(this).closest('.price-block').find('.price-drop-detail').toggle();
    });

    $(document).on('click', '.view-imei-net-margin', function () {
        var $btn = $(this);
        var $row = $btn.closest('tr');
        var imei = $row.find('input.serialNumber').val();
        imei = (imei || '').trim();

        if (!imei) {
            bootbox.alert('Enter an IMEI first.');
            return;
        }

        var fofoId = $btn.data('fofoid');
        if (!fofoId) {
            fofoId = $('#currentFofoId').val();
        }

        var loader = '<div class="modal-header"><h4 class="modal-title">IMEI Scheme Margin</h4></div>'
                + '<div class="modal-body"><div style="text-align:center;padding:20px;">'
                + '<i class="fa fa-spinner fa-spin fa-2x"></i></div></div>';
        $('#imeiNetMarginModal .modal-content').html(loader);
        $('#imeiNetMarginModal').modal('show');

        var url = context + '/getImeiNetMarginModal?searchImei=' + encodeURIComponent(imei)
                + '&fofoId=' + encodeURIComponent(fofoId);
        doGetAjaxRequestHandler(url, function (response) {
            $('#imeiNetMarginModal .modal-content').html(response);
        });
    });
});