delete.js 488 B

123456789101112131415
  1. import $ from 'jquery';
  2. $(document).on('click', '[data-remodal-target="delete"]', function() {
  3. let confirm = $('[data-remodal-id="delete"] [data-delete-action]');
  4. let link = $(this).data('delete-url');
  5. confirm.data('delete-action', link);
  6. });
  7. $(document).on('click', '[data-delete-action]', function() {
  8. let remodal = $.remodal.lookup[$('[data-remodal-id="delete"]').data('remodal')];
  9. global.location.href = $(this).data('delete-action');
  10. remodal.close();
  11. });