WII.. Finally add a confirmation before deleting a note.

This commit is contained in:
Matias De lellis
2019-02-12 15:08:03 -03:00
parent a69071d00a
commit 2245c7f00f

View File

@@ -359,6 +359,11 @@ View.prototype = {
event.stopPropagation();
self._notes.load(id);
OC.dialogs.confirm(
t('quicknotes', 'Are you sure you want to delete the note?'),
t('quicknotes', 'Delete note'),
function(result) {
if (result) {
self._notes.removeActive().done(function () {
if (self._notes.length() > 0) {
$(".notes-grid").isotope('remove', note.parent())
@@ -371,6 +376,10 @@ View.prototype = {
}).fail(function () {
alert('Could not delete note, not found');
});
}
},
true
);
});
/*
@@ -595,12 +604,20 @@ View.prototype = {
$('#app-navigation .note .delete').click(function () {
var entry = $(this).closest('.note');
entry.find('.app-navigation-entry-menu').removeClass('open');
OC.dialogs.confirm(
t('quicknotes', 'Are you sure you want to delete the note?'),
t('quicknotes', 'Delete note'),
function(result) {
if (result) {
self._notes.removeActive().done(function () {
self.render();
}).fail(function () {
alert('Could not delete note, not found');
});
}
},
true
);
});
// show a note