don't close value after generator result applied

This commit is contained in:
antelle 2016-08-14 22:14:20 +03:00
parent ae96fca478
commit e28d58a1cf
1 changed files with 6 additions and 2 deletions

View File

@ -125,9 +125,13 @@ var FieldViewText = FieldView.extend({
var code = e.keyCode || e.which;
if (code === Keys.DOM_VK_RETURN) {
if (!this.model.multiline || (!e.altKey && !e.shiftKey && !e.ctrlKey)) {
let value = this.gen ? this.gen.password : e.target.value;
if (this.gen) {
e.target.value = this.gen.password;
this.hideGenerator();
return;
}
this.stopListening(Backbone, 'click', this.fieldValueBlur);
this.endEdit(value);
this.endEdit(e.target.value);
}
} else if (code === Keys.DOM_VK_ESCAPE) {
this.stopListening(Backbone, 'click', this.fieldValueBlur);