/* Minification failed. Returning unminified contents.
(1,20): run-time error CSS1031: Expected selector, found '='
(1,20): run-time error CSS1025: Expected comma or open brace, found '='
 */
var GetNewsClosure = (function () {

    // These variables are used by dialogs
    var NewsID;
    var DeleteUrl = "/Admin/News/DeleteNews";
    var ConfirmUrl = "/Admin/News/GetNews";

    $('.delete-news-button').click(function (e) {
        e.preventDefault();
        NewsID = $(this).data('id');

        var News = $(this).data('name');

        $('#confirmation-dialog .modal-body p').text('You choose to delete news "' + News + '". Are you sure?');
    });

    $("#confirm-dialog").click(function () {
        $.ajax({
            type: "POST",
            url: DeleteUrl,
            data: { id: NewsID },
            success: function (res) {
                    $('#confirmation-dialog').modal('toggle');
                    $('#all-news-table > tbody > tr[data-newsid = ' + NewsID + ']').remove();
                    updateNumberOfEntitiesAfterDelete();
                },
            error: function () {
                $('#confirmation-dialog').modal('toggle');
                $('#error-dialog').modal('toggle');
            }
        });
    });

    return {
        'NewsID': NewsID,
        'DeleteUrl': DeleteUrl,
        'ConfirmUrl': ConfirmUrl
    }

}());

