diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index 3b840022b..9a92188f3 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -212,8 +212,8 @@ define([ value : '' }); this.lockedControls.push(this.txtNewValue); - this.txtNewValue.on('changed:after', this.onAddItem.bind(this)); this.txtNewValue.on('inputleave', function(){ me.fireEvent('editcomplete', me);}); + this.txtNewValue._input.on('keydown', _.bind(this.onNewValueKeydown, this)); this.list = new Common.UI.ListView({ el: $markup.findById('#form-list-list'), @@ -457,6 +457,12 @@ define([ } }, + onNewValueKeydown: function(event) { + if (this.api && !this._noApply && event.keyCode == Common.UI.Keys.RETURN) { + this.onAddItem(); + } + }, + onAddItem: function() { var store = this.list.store, value = this.txtNewValue.getValue();