/*<![CDATA[*/
$(document).ready(function () {
    $(".paper-row").mouseenter(function (event) {
        var paperRow = $(event.target).closest(".paper-row");
        $(paperRow).css("background-color", "#f8f9fa");
        $(paperRow).find(".remove-paper").removeClass("d-none");

    });
    $(".paper-row").mouseleave(function (event) {
        var paperRow = $(event.target).closest(".paper-row");
        $(paperRow).css("background-color", "white");
        $(paperRow).closest(".paper-row").find(".remove-paper").addClass("d-none");
    });

    $('a[data-confirm]').click(function(ev) {
        var href = $(this).attr('href');
        if (!$('#dataConfirmModal').length) {
            $('#modalDelete').append('<div class="modal fade" id="dataConfirmModal"  tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true"\n' +
                '             >\n' +
                '            <div class="modal-dialog modal-sm">\n' +
                '                <div class="modal-content">\n' +
                '                    <div class="modal-header">\n' +
                '                        <h8 class="modal-title" id="myModalLabel">Удалить статью?</h8>\n' +
                '                        <button type="button" class="close" data-dismiss="modal" aria-label="Закрыть"><span\n' +
                '                                aria-hidden="true">&times;</span></button>\n' +
                '                    </div>\n' +

                '                    <div class="modal-footer">\n' +
                '                       <a class="btn btn-primary" id="dataConfirmOK">Да</a>'+
                '                       <button class="btn primary" data-dismiss="modal" aria-hidden="true">Нет</button>'+
                '                    </div>\n' +
                '                </div>\n' +
                '            </div>\n' +
                '        </div>');
        }
        $('#dataConfirmModal').find('#myModalLabel').text($(this).attr('data-confirm'));
        $('#dataConfirmOK').attr('href', href);
        $('#dataConfirmModal').modal({show:true});
        return false;
    });
});
/*]]>*/