Skip to content

Commit bff99fa

Browse files
committed
fixes #1829
1 parent d606210 commit bff99fa

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ All Notable changes to `Backpack CRUD` will be documented in this file
2020
- Nothing
2121
-----------
2222

23-
## [3.6.11] - 2019-04-xx
23+
## [3.6.11] - 2019-04-09
2424

2525
### Fixed
2626
- #1851 - cdn.rawgit.com will stop working in October 2019; switched to a different CDN;
2727
- merged #1822 - vertical tabs can be enabled and switched with one line instead of two;
28+
- #1829 - when the item is not deleted, a success bubble is no longer shown, but a warning;
2829

2930

3031
## [3.6.10] - 2019-04-01

src/resources/views/buttons/delete.blade.php

+23-14
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,32 @@ function deleteEntry(button) {
1818
url: route,
1919
type: 'DELETE',
2020
success: function(result) {
21-
// Show an alert with the result
22-
new PNotify({
23-
title: "{{ trans('backpack::crud.delete_confirmation_title') }}",
24-
text: "{{ trans('backpack::crud.delete_confirmation_message') }}",
25-
type: "success"
26-
});
21+
if (result != 1) {
22+
// Show an error alert
23+
new PNotify({
24+
title: "{{ trans('backpack::crud.delete_confirmation_not_title') }}",
25+
text: "{{ trans('backpack::crud.delete_confirmation_not_message') }}",
26+
type: "warning"
27+
});
28+
} else {
29+
// Show a success alert with the result
30+
new PNotify({
31+
title: "{{ trans('backpack::crud.delete_confirmation_title') }}",
32+
text: "{{ trans('backpack::crud.delete_confirmation_message') }}",
33+
type: "success"
34+
});
2735
28-
// Hide the modal, if any
29-
$('.modal').modal('hide');
36+
// Hide the modal, if any
37+
$('.modal').modal('hide');
3038
31-
// Remove the details row, if it is open
32-
if (row.hasClass("shown")) {
33-
row.next().remove();
34-
}
39+
// Remove the details row, if it is open
40+
if (row.hasClass("shown")) {
41+
row.next().remove();
42+
}
3543
36-
// Remove the row from the datatable
37-
row.remove();
44+
// Remove the row from the datatable
45+
row.remove();
46+
}
3847
},
3948
error: function(result) {
4049
// Show an alert with the result

0 commit comments

Comments
 (0)