confirmation for deleting an entry on mobile

This commit is contained in:
antelle 2019-09-08 14:20:11 +02:00
parent ba57bf9503
commit 3df178a026
3 changed files with 18 additions and 2 deletions

View File

@ -258,6 +258,8 @@
"detDelFromTrash": "Delete from trash?",
"detDelFromTrashBody": "You will not be able to put it back.",
"detDelFromTrashBodyHint": "To quickly remove all items from trash, click Empty icon in Trash menu.",
"detDelToTrash": "Delete the entry?",
"detDelToTrashBody": "The entry will be moved to the trash folder.",
"detFieldCopied": "Copied",
"detFieldCopiedTime": "Copied for {} seconds",
"detCopyHint": "You can copy field value with click on its title",

View File

@ -29,6 +29,7 @@ const Format = require('../../util/format');
const Locale = require('../../util/locale');
const Tip = require('../../util/tip');
const FileSaver = require('../../util/file-saver');
const FeatureDetector = require('../../util/feature-detector');
const Timeouts = require('../../const/timeouts');
const Copyable = require('../../mixins/copyable');
@ -943,8 +944,20 @@ const DetailsView = Backbone.View.extend({
},
moveToTrash() {
this.model.moveToTrash();
Backbone.trigger('refresh');
const doMove = () => {
this.model.moveToTrash();
Backbone.trigger('refresh');
};
if (FeatureDetector.isMobile) {
Alerts.yesno({
header: Locale.detDelToTrash,
body: Locale.detDelToTrashBody,
icon: 'trash',
success: doMove
});
} else {
doMove();
}
},
clone() {

View File

@ -10,6 +10,7 @@ Release notes
`-` fixed field editing styles
`*` dropped support for browsers without css variables
`*` displaying websites as HTTPS if no scheme is provided
`+` confirmation for deleting an entry on mobile
##### v1.9.3 (2019-09-07)
`-` fixed group settings not being displayed