mirror of https://github.com/keeweb/keeweb
entry title edit fix
parent
96effc1733
commit
cbedf572ba
|
@ -110,8 +110,8 @@ var EntryModel = Backbone.Model.extend({
|
|||
this.entry.pushHistory();
|
||||
this.file.setModified();
|
||||
}
|
||||
if (this.isNew) {
|
||||
this.isNew = false;
|
||||
if (this.isJustCreated) {
|
||||
this.isJustCreated = false;
|
||||
}
|
||||
this.entry.times.update();
|
||||
},
|
||||
|
@ -248,7 +248,7 @@ EntryModel.newEntry = function(group, file) {
|
|||
model.setEntry(entry, group, file);
|
||||
model.entry.times.update();
|
||||
model.unsaved = true;
|
||||
model.isNew = true;
|
||||
model.isJustCreated = true;
|
||||
group.addEntry(model);
|
||||
file.setModified();
|
||||
return model;
|
||||
|
|
|
@ -237,7 +237,7 @@ var DetailsView = Backbone.View.extend({
|
|||
showEntry: function(entry) {
|
||||
this.model = entry;
|
||||
this.render();
|
||||
if (entry && !entry.title && entry.isNew) {
|
||||
if (entry && !entry.title && entry.isJustCreated) {
|
||||
this.editTitle();
|
||||
}
|
||||
},
|
||||
|
@ -381,7 +381,7 @@ var DetailsView = Backbone.View.extend({
|
|||
this.setTitle(e.target.value);
|
||||
} else if (code === Keys.DOM_VK_ESCAPE) {
|
||||
$(e.target).unbind('blur');
|
||||
if (this.model.isNew) {
|
||||
if (this.model.isJustCreated) {
|
||||
this.model.removeWithoutHistory();
|
||||
Backbone.trigger('refresh');
|
||||
return;
|
||||
|
@ -398,7 +398,7 @@ var DetailsView = Backbone.View.extend({
|
|||
},
|
||||
|
||||
setTitle: function(title) {
|
||||
if (!title && this.model.isNew) {
|
||||
if (!title && this.model.isJustCreated) {
|
||||
this.model.removeWithoutHistory();
|
||||
Backbone.trigger('refresh');
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue