<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/**
 * @file:
 * @author: Pokusaiev Kyrylo &lt;pokusaiev.k@gmail.com&gt;
 * @date: 31.01.2019
 */


var PriceListCsvExportPopup = (function (_parent) {
    extend(PriceListCsvExportPopup, _parent);

    function PriceListCsvExportPopup(opts)
    {
        this.id = null;

        this.defaults = {
            isLiveBinding: true,
            bindDefaultActions: true
        };

        this.opts = {
            viewUrl: null,
            submitUrl: null
        };

        _parent.apply(this, arguments);
    }

    PriceListCsvExportPopup.prototype.bindActions = function () {
        this.liveJq('click', this.id + ' .action-submit', this.formSubmit);
        this.liveJq('click', '#link-csv_report', this.ajaxShow);
    };

    PriceListCsvExportPopup.prototype.ajaxShow = function (params) {
        this.ajaxLoad(this.opts.viewUrl, {}, params);

        return false;
    };

    PriceListCsvExportPopup.prototype.show = function (params) {
        _parent.prototype.show.apply(this, arguments);

        return false;
    };

    PriceListCsvExportPopup.prototype.formSubmit = function () {
        var form = $(this.id).find('form');
        this.postJson(this.opts.submitUrl, form.serialize(), function (response) {
            if (response.success) {
                this.close();
            } else {
                $(this.id).html(response.html);
            }
        });

        return false;
    };

    return PriceListCsvExportPopup;
})(Dialog);
</pre></body></html>