view gcalendar/static/js/gcalendar_edit.js @ 1163:44e55e4317f8

Merge with mainline.
author Brian Neal <bgneal@gmail.com>
date Tue, 07 Mar 2017 19:47:18 -0600
parents 110bbc78a482
children
line wrap: on
line source
$(document).ready(function() {
   $('.gcal-del').click(function () {
      if (confirm('Really delete this event?')) {
         var id = this.id;
         if (id.match(/gcal-(\d+)/)) {
            $.ajax({
               url: '/calendar/delete/', 
               type: 'POST',
               data: { id : RegExp.$1 }, 
               dataType: 'text',
               success: function (id) {
                  var rowId = '#gcal-row-' + id;
                  $(rowId).fadeOut(800);
               }, 
               error: function (xhr, textStatus, ex) {
                  alert('Oops, an error occurred. ' + xhr.statusText + ' - ' + 
                     xhr.responseText);
               }
            });
         }
      }
      return false;
      });
});