Commit 5eeaabd6 authored by joriot221's avatar joriot221
Browse files

Mise a jour des fichiers lors de la suppression

parent 6fc35ab9
Loading
Loading
Loading
Loading
+2 −30
Changes for public/js/piece-jointe.js: 2 added lines, 30 removed lines.
Original line number Diff line number Diff line
@@ -12,15 +12,11 @@ $.widget("ose.pieceJointe", {
            event.preventDefault();
        });

        that.element.on('click', '.refuser-pj', function (event) {
            that.refuser($(this));
            event.preventDefault();
        });

        $("body").on("pj-refus-event", function (event, container) {
            var tpj = event.a.data('tpj');
            that.onFileChange(tpj);
            that.refreshContainerValidationBar();
            that.getContainer(tpj).find('.uploaded-files-div').refresh();
            event.preventDefault();

        });

@@ -93,30 +89,6 @@ $.widget("ose.pieceJointe", {
        });
    },

    refuser: function (element)
    {
        var that = this;
        var tpj = element.parents('.tpj').data('tpj');

        element.button('loading');


        $.ajax({
            type: 'POST',
            url: element.prop('href'),
            data: {},
            success: function (data, textStatus, jqXHR) {
            },
            error: function (jqXHR) {
                alert('Une erreur est survenue. L\'opération n\'a pas pu être effectuée.');
                console.log(jqXHR);
            },
            complete: function (jqXHR) {
                that.onFileChange(tpj);
            }
        });
    },

    onValidationChange: function (tpj, isValider)
    {
        this.refreshFiles(tpj, isValider);