delete.js 468 B

123456789101112131415
  1. import $ from 'jquery';
  2. $('[data-remodal-target="delete"]').on('click', 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. $('[data-delete-action]').on('click', function() {
  8. let remodal = $.remodal.lookup[$('[data-remodal-id="delete"]').data('remodal')];
  9. global.location.href = $(this).data('delete-action');
  10. remodal.close();
  11. });