Skip to content

Commit

Permalink
Focus the first field in the part editor window when it has been opened
Browse files Browse the repository at this point in the history
  • Loading branch information
Felicitus committed Jan 4, 2012
1 parent 595529d commit 1d2bf30
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/frontend/js/Components/Part/Editor/PartEditor.js
Expand Up @@ -19,13 +19,16 @@ Ext.define('PartKeepr.PartEditor', {
*/
initComponent: function () {

this.nameField = Ext.create("Ext.form.field.Text", {
name: 'name',
fieldLabel: i18n("Name"),
allowBlank: false,
labelWidth: 150
});

// Defines the basic editor fields
var basicEditorFields = [{
xtype: 'textfield',
name: 'name',
fieldLabel: i18n("Name"),
allowBlank: false
},
var basicEditorFields = [
this.nameField,
{
layout: 'column',
bodyStyle: 'background:#DBDBDB',
Expand Down Expand Up @@ -189,6 +192,7 @@ Ext.define('PartKeepr.PartEditor', {
},
onEditStart: function () {
this.bindChildStores();
this.nameField.focus();
},
_onItemSaved: function () {
this.fireEvent("partSaved", this.record);
Expand Down

0 comments on commit 1d2bf30

Please sign in to comment.