app/assets/javascripts/cm_admin/scaffolds.js in cm-admin-1.5.1 vs app/assets/javascripts/cm_admin/scaffolds.js in cm-admin-1.5.6
- old
+ new
@@ -52,12 +52,13 @@
if (!popup.is(e.target) && popup.has(e.target).length === 0) {
popup.addClass('hidden');
}
});
-$(document).on('click', '.destroy-attachment', function(e) {
- var ar_id = $(this).data('ar-id')
- $(this).addClass('hidden')
+$(document).on('click', '.destroy-attachment button', function(e) {
+ e.preventDefault();
+ var ar_id = $(this).parent('.destroy-attachment').data('ar-id')
+ $(this).parent('.destroy-attachment').addClass('hidden')
$(this).append('<input type="text" name="attachment_destroy_ids[]" value="' + ar_id + '"/>')
})
window.addEventListener('popstate', e => window.location.reload() );
\ No newline at end of file