webseite-grav/plugins/admin/themes/grav/app/pages/page/delete.js

16 lines
488 B
JavaScript
Raw Normal View History

2021-04-30 11:23:26 +02:00
import $ from 'jquery';
$(document).on('click', '[data-remodal-target="delete"]', function() {
let confirm = $('[data-remodal-id="delete"] [data-delete-action]');
let link = $(this).data('delete-url');
confirm.data('delete-action', link);
});
$(document).on('click', '[data-delete-action]', function() {
let remodal = $.remodal.lookup[$('[data-remodal-id="delete"]').data('remodal')];
global.location.href = $(this).data('delete-action');
remodal.close();
});