class OilList {
    constructor() {
        this.form = document.getElementById("fSearch");

        let tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
        let tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
            return new bootstrap.Tooltip(tooltipTriggerEl, {
                html: true,
                trigger: "click"
            });
        });
    }

    ChangePerPage(e) {
        this.form.elements["page"].value = 1;
        this.submit();
    }

    submit() {
        this.form.submit();
    }
}

const oilList = new OilList();

$(document).on("change", "#perPage", (e) => oilList.ChangePerPage(e));

$(document).on("change", "#sDate, #eDate", (e) => oilList.submit(e));
