close question

This commit is contained in:
Antelle 2015-10-25 12:19:00 +03:00
parent cf66e65f74
commit 0f77eca492
3 changed files with 11 additions and 3 deletions

View File

@ -9,6 +9,7 @@
- [ ] move groups/entries
- [ ] help/tips
- [ ] switch view
- [ ] lock without closing
- [ ] merge
- [ ] generation templates
- [ ] advanced search

View File

@ -195,7 +195,15 @@ var AppView = Backbone.View.extend({
},
lockWorkspace: function() {
this.model.closeAllFiles();
if (this.model.files.hasUnsavedFiles()) {
Alerts.yesno({
header: 'Unsaved changes',
body: 'You have unsaved changes that will be lost. Continue?',
success: this.model.closeAllFiles.bind(this.model)
});
} else {
this.model.closeAllFiles();
}
},
saveAll: function() {

View File

@ -10,8 +10,7 @@
<div class="open__file-password">
<div class="open__file-title">
<% if (name) { %>
<a class="open__file-link-name <%= opening ? 'disabled' : '' %> muted-color"><%- name %></a> / <a
class="open__file-link-name muted-color" <%= opening ? 'disabled' : '' %>>Another</a>
<a class="open__file-link-name muted-color" <%= opening ? 'disabled' : '' %>>Open another</a>
<% } else { %>
<a class="open__file-link-open muted-color" <%= opening ? 'disabled' : '' %>>Open</a> / <a
class="open__file-link-new muted-color" <%= opening ? 'disabled' : '' %>>New</a> / <a