simplified new entry creation

This commit is contained in:
Antelle 2015-10-18 15:18:53 +03:00
parent 4ec6d8cc9a
commit aed45a5b70
3 changed files with 5 additions and 1 deletions

View File

@ -154,6 +154,7 @@ var AppModel = Backbone.Model.extend({
}
var entry = EntryModel.newEntry(group, file);
group.addEntry(entry);
entry.isNew = true;
return entry;
}
});

View File

@ -236,6 +236,9 @@ var DetailsView = Backbone.View.extend({
showEntry: function(entry) {
this.model = entry;
this.render();
if (!entry.title && entry.isNew) {
this.editTitle();
}
},
copyKeyPress: function() { // TODO: fix this in Safari

View File

@ -27,7 +27,7 @@ var FieldView = Backbone.View.extend({
update: function() {
if (typeof this.model.value === 'function') {
var newVal = this.model.value();
if (!_.isEqual(newVal, this.value)) {
if (!_.isEqual(newVal, this.value) || (this.value && newVal && this.value.toString() !== newVal.toString())) {
this.render();
}
}