Projet

Général

Profil

« Précédent | Suivant » 

Révision 7b8d8bd5

Ajouté par Serghei Mihai (congés, retour 15/05) il y a presque 10 ans

agenda: icon displayed or hidden on comment update

Closes #2509

Voir les différences:

calebasse/static/js/calebasse.agenda.js
80 80
          }
81 81
          else
82 82
          {
83
            var data = {description: textarea.val() };
84
            var data = JSON.stringify(data);
83
            var comment = {description: textarea.val()};
84
            var data = JSON.stringify(comment);
85 85
            $.ajax({
86 86
              url: '/api/v1/event/' + $(this).data("event-id") + '/?format=json&date=' + $(this).data('date'),
87 87
              type: 'PATCH',
88 88
              contentType: 'application/json',
89 89
              data: data,
90
              success: function(data) {
90
              success: function(response) {
91 91
                btn.attr('disabled', 'disabled');
92
                if (comment['description'])
93
                    $('h3#' + btn.data("event-id") + ' span.icon-comment').fadeIn();
94
                else
95
                    $('h3#' + btn.data("event-id") + ' span.icon-comment').fadeOut();
92 96
                span.html('Commentaire modifié avec succès');
93 97
              }
94 98
            });

Formats disponibles : Unified diff