commit c666d3754058d70a23b24343bb2604cf58ff9b64
parent 7315a0bb868dc7edf9db687073016442eb45b1fa
Author: Felicitus <felicitus@felicitus.org>
Date: Thu, 30 Jun 2011 02:56:00 +0200
Usability: Save category when return was hit
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/frontend/js/Components/CategoryEditor/CategoryEditorWindow.js b/frontend/js/Components/CategoryEditor/CategoryEditorWindow.js
@@ -7,6 +7,12 @@ Ext.define('PartKeepr.CategoryEditorWindow', {
this.form = Ext.create("PartKeepr.CategoryEditorForm");
+ this.keys = [{
+ key: Ext.EventObject.ENTER,
+ handler: this.onEnter,
+ scope: this
+ }];
+
this.buttons = [{
text: i18n("Save"),
handler: Ext.bind(this.onSave, this)
@@ -40,6 +46,9 @@ Ext.define('PartKeepr.CategoryEditorWindow', {
this.on("show", Ext.bind(this.onShow, this));
},
+ onEnter: function () {
+ this.onSave();
+ },
onShow: function () {
this.form.items.first().focus();
},