
$(function () {
    //wysyłanie formularza paginacji
    $('select[name=per_page]').change(function () {
        $(this).parent().submit();
    });
});

$(function() {
    if($('.datePickerStart').length>0){
        $('.datePickerStart').datetimepicker({
            format: 'Y/m/d',
            onShow: function (ct) {
                this.setOptions({
                    maxDate: jQuery('.datePickerStop').val() ? jQuery('.datePickerStop').val() : false
                })
            },
            timepicker: false,
            closeOnDateSelect: true,
            scrollInput: false
        });
    }
    if($('.datePickerStop').length>0){
        $('.datePickerStop').datetimepicker({
            format: 'Y/m/d',
            onShow: function (ct) {
                this.setOptions({
                    minDate: jQuery('.datePickerStart').val() ? jQuery('.datePickerStart').val() : false
                })
            },
            timepicker: false,
            closeOnDateSelect: true,
            scrollInput: false
        });
    }
});

$(function () {
    "use strict";
    if($('.tooltipster-top').length>0){
        $('.tooltipster-top').tooltipster({
            position: "top"
        });
    }
});

$(function () {
    "use strict";
    if($('#editionList').length>0){
        $('#editionList').dataTable({
            ordering: false,
            searching: false,
            paging: false,
            info: false,
            "order": [
                [0, "desc"]
            ],
            "dom": '<f<t><"bottom"ilp>><"clear">',
            language: {
                url: language,
            }
        });
    }
});