mirror of https://github.com/keeweb/keeweb.git
show warning for deleting modified files
This commit is contained in:
parent
e6f56526ac
commit
452830b651
|
@ -126,6 +126,7 @@ var Locale = {
|
|||
openPassFor: 'Password for',
|
||||
openRemoveLastQuestion: 'Delete local file?',
|
||||
openRemoveLastQuestionBody: 'The file you are deleting is stored only inside the app. Delete it permanently?',
|
||||
openRemoveLastQuestionModBody: 'The file you are deleting has local modifications. Delete it and discard these modifications?',
|
||||
openLocalFile: 'Local file',
|
||||
openLocalFileBody: 'You are going to open a file which will be stored inside the app. ' +
|
||||
'Changes you make will not be saved back to file system. ' +
|
||||
|
|
|
@ -288,11 +288,11 @@ var OpenView = Backbone.View.extend({
|
|||
var id = $(e.target).closest('.open__last-item').data('id').toString();
|
||||
if ($(e.target).is('.open__last-item-icon-del')) {
|
||||
var fileInfo = this.model.fileInfos.get(id);
|
||||
if (!fileInfo.get('storage')) {
|
||||
if (!fileInfo.get('storage') || fileInfo.get('modified')) {
|
||||
var that = this;
|
||||
Alerts.yesno({
|
||||
header: Locale.openRemoveLastQuestion,
|
||||
body: Locale.openRemoveLastQuestionBody,
|
||||
body: fileInfo.get('modified') ? Locale.openRemoveLastQuestionModBody : Locale.openRemoveLastQuestionBody,
|
||||
buttons: [
|
||||
{result: 'yes', title: Locale.alertYes},
|
||||
{result: '', title: Locale.alertNo}
|
||||
|
|
Loading…
Reference in New Issue