$(function () {
    $('.delete-button').on('click', function(event) {
        event.preventDefault();
        var ajax_type = $(this).attr('data-type');
        var id = $('#delete-modal').attr('data-id');
        $('#list-' + id).remove();
        $.post('{{CONFIG ajax_url}}/ap/delete-' + ajax_type, {id: id});
    });
});

var PT_Delay = (function(){
  var timer = 0;
  return function(callback, ms){
    clearTimeout (timer);
    timer = setTimeout(callback, ms);
  };
})();
