//
// Datatable
//

'use strict';

var DatatableBasic = (function () {

    // Variables

    var $dtBasic = $('#datatable-basic');


    // Methods

    function init($this) {

        // Basic options. For more options check out the Datatables Docs:
        // https://datatables.net/manual/options

        var options = {
            keys: !0,
            select: {
                style: "multi"
            },
            language: {
                paginate: {
                    previous: "<i class='fas fa-angle-left'>",
                    next: "<i class='fas fa-angle-right'>"
                }
            },
        };

        // Init the datatable

        var table = $this.on('init.dt', function () {
            $('div.dataTables_length select').removeClass('custom-select custom-select-sm');

        }).DataTable(options);
    }


    // Events

    if ($dtBasic.length) {
        init($dtBasic);
    }

})();


//
// Buttons Datatable
//

var DatatableButtons = (function () {

    // Variables

    var $dtButtons = $('#datatable-buttons');


    // Methods

    function init($this) {

        // For more options check out the Datatables Docs:
        // https://datatables.net/extensions/buttons/

        var buttons = ["copy", "print"];

        // Basic options. For more options check out the Datatables Docs:
        // https://datatables.net/manual/options

        var options = {

            lengthChange: !1,
            dom: 'Bfrtip',
            buttons: buttons,
            // select: {
            // 	style: "multi"
            // },
            language: {
                paginate: {
                    previous: "<i class='fas fa-angle-left'>",
                    next: "<i class='fas fa-angle-right'>"
                }
            }
        };

        // Init the datatable

        var table = $this.on('init.dt', function () {
            $('.dt-buttons .btn').removeClass('btn-secondary').addClass('btn-sm btn-default');
        }).DataTable(options);
    }


    // Events

    if ($dtButtons.length) {
        init($dtButtons);
    }

})();
