From a4266b167c688746ee0db0e2338eecd238bdb51d Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Mon, 7 Mar 2011 20:05:38 +0100 Subject: [PATCH] added helpText attributes to Sonia.group.FormPanel --- .../main/webapp/resources/js/sonia.group.js | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) 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 2e977580ae..819a914aee 100644 --- a/scm-webapp/src/main/webapp/resources/js/sonia.group.js +++ b/scm-webapp/src/main/webapp/resources/js/sonia.group.js @@ -149,6 +149,11 @@ Sonia.group.FormPanel = Ext.extend(Sonia.rest.FormPanel,{ errorTitleText: 'Error', updateErrorMsgText: 'Group update failed', createErrorMsgText: 'Group creation failed', + + // help + nameHelpText: 'The unique name for the group.', + descriptionHelpText: 'A short description for the group.', + membersHelpText: 'The usernames of the group members.', memberStore: null, @@ -214,11 +219,13 @@ Sonia.group.FormPanel = Ext.extend(Sonia.rest.FormPanel,{ fieldLabel: this.nameText, name: 'name', allowBlank: false, - readOnly: this.item != null + readOnly: this.item != null, + helpText: this.nameHelpText },{ fieldLabel: this.descriptionText, name: 'description', - xtype: 'textarea' + xtype: 'textarea', + helpText: this.descriptionHelpText }] },{ id: 'memberGrid', @@ -255,6 +262,13 @@ Sonia.group.FormPanel = Ext.extend(Sonia.rest.FormPanel,{ this.memberStore.remove(selected); } } + },'->',{ + id: 'memberGridHelp', + xtype: 'box', + autoEl: { + tag: 'img', + src: 'resources/images/help.gif' + } }] }]; @@ -262,6 +276,18 @@ Sonia.group.FormPanel = Ext.extend(Sonia.rest.FormPanel,{ Sonia.group.FormPanel.superclass.initComponent.apply(this, arguments); }, + afterRender: function(){ + // call super + Sonia.group.FormPanel.superclass.afterRender.apply(this, arguments); + + Ext.QuickTips.register({ + target: Ext.getCmp('memberGridHelp'), + title: '', + text: this.membersHelpText, + enabled: true + }); + }, + updateMembers: function(item){ var members = []; this.memberStore.data.each(function(record){