mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-12-01 07:37:18 +01:00
WII.. Finally add a confirmation before deleting a note.
This commit is contained in:
53
js/script.js
53
js/script.js
@@ -359,18 +359,27 @@ View.prototype = {
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
self._notes.load(id);
|
self._notes.load(id);
|
||||||
self._notes.removeActive().done(function () {
|
OC.dialogs.confirm(
|
||||||
if (self._notes.length() > 0) {
|
t('quicknotes', 'Are you sure you want to delete the note?'),
|
||||||
$(".notes-grid").isotope('remove', note.parent())
|
t('quicknotes', 'Delete note'),
|
||||||
.isotope('layout');
|
function(result) {
|
||||||
self.showAll();
|
if (result) {
|
||||||
self.renderNavigation();
|
self._notes.removeActive().done(function () {
|
||||||
} else {
|
if (self._notes.length() > 0) {
|
||||||
self.render();
|
$(".notes-grid").isotope('remove', note.parent())
|
||||||
}
|
.isotope('layout');
|
||||||
}).fail(function () {
|
self.showAll();
|
||||||
alert('Could not delete note, not found');
|
self.renderNavigation();
|
||||||
});
|
} else {
|
||||||
|
self.render();
|
||||||
|
}
|
||||||
|
}).fail(function () {
|
||||||
|
alert('Could not delete note, not found');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
true
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -595,12 +604,20 @@ View.prototype = {
|
|||||||
$('#app-navigation .note .delete').click(function () {
|
$('#app-navigation .note .delete').click(function () {
|
||||||
var entry = $(this).closest('.note');
|
var entry = $(this).closest('.note');
|
||||||
entry.find('.app-navigation-entry-menu').removeClass('open');
|
entry.find('.app-navigation-entry-menu').removeClass('open');
|
||||||
|
OC.dialogs.confirm(
|
||||||
self._notes.removeActive().done(function () {
|
t('quicknotes', 'Are you sure you want to delete the note?'),
|
||||||
self.render();
|
t('quicknotes', 'Delete note'),
|
||||||
}).fail(function () {
|
function(result) {
|
||||||
alert('Could not delete note, not found');
|
if (result) {
|
||||||
});
|
self._notes.removeActive().done(function () {
|
||||||
|
self.render();
|
||||||
|
}).fail(function () {
|
||||||
|
alert('Could not delete note, not found');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
true
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// show a note
|
// show a note
|
||||||
|
|||||||
Reference in New Issue
Block a user