mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-11-30 23:37:16 +01:00
WII.. Finally add a confirmation before deleting a note.
This commit is contained in:
19
js/script.js
19
js/script.js
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user