From df9ba08b5402cdfc35258fcd3ce938a3e03de29c Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Tue, 7 Sep 2010 18:24:54 +0200 Subject: [PATCH] set focus to name field --- .../src/main/webapp/resources/js/sonia.group.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scm-webapp/src/main/webapp/resources/js/sonia.group.js b/scm-webapp/src/main/webapp/resources/js/sonia.group.js index 91c18a1c40..c609b5d73e 100644 --- a/scm-webapp/src/main/webapp/resources/js/sonia.group.js +++ b/scm-webapp/src/main/webapp/resources/js/sonia.group.js @@ -12,14 +12,24 @@ Sonia.group.EditForm = new Ext.extend(Sonia.rest.EditForm, { fields: [ 'name' ] }); + var update = this.data != null; + var config = { title: 'Edit Group', + listeners: { + afterrender: function(){ + if ( ! update ){ + Ext.getCmp('nameField').focus(true, 500); + } + } + }, items:[{ + id: 'nameField', fieldLabel:'Name', name:'name', anchor: '100%', allowBlank: false, - readOnly: this.data != null + readOnly: update },{ fieldLabel: 'Members', xtype: 'fieldset',