mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
fix cancel button
This commit is contained in:
@@ -394,16 +394,11 @@ Sonia.repository.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
|
||||
});
|
||||
},
|
||||
|
||||
reset: function(){
|
||||
cancel: function(){
|
||||
if ( debug ){
|
||||
console.debug( 'reset form' );
|
||||
}
|
||||
this.getForm().reset();
|
||||
if ( this.item != null ){
|
||||
this.permissionStore.loadData( this.item );
|
||||
} else {
|
||||
this.permissionStore.removeAll();
|
||||
console.debug( 'cancel form' );
|
||||
}
|
||||
Sonia.repository.setEditPanel( Sonia.repository.DefaultPanel );
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -152,7 +152,7 @@ Sonia.rest.FormPanel = Ext.extend(Ext.FormPanel,{
|
||||
buttonAlign: 'center',
|
||||
buttons: [
|
||||
{text: 'Ok', formBind: true, scope: this, handler: this.submit},
|
||||
{text: 'Cancel', scope: this, handler: this.reset}
|
||||
{text: 'Cancel', scope: this, handler: this.cancel}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ Sonia.rest.FormPanel = Ext.extend(Ext.FormPanel,{
|
||||
}
|
||||
},
|
||||
|
||||
reset: function(){
|
||||
cancel: function(){
|
||||
if ( debug ){
|
||||
console.debug( 'reset form' );
|
||||
}
|
||||
|
||||
@@ -32,6 +32,26 @@
|
||||
// register namespace
|
||||
Ext.ns('Sonia.user');
|
||||
|
||||
|
||||
// functions
|
||||
|
||||
Sonia.user.setEditPanel = function(panel){
|
||||
var editPanel = Ext.getCmp('userEditPanel');
|
||||
editPanel.removeAll();
|
||||
editPanel.add(panel);
|
||||
editPanel.doLayout();
|
||||
}
|
||||
|
||||
// Panels
|
||||
|
||||
Sonia.user.DefaultPanel = {
|
||||
region: 'south',
|
||||
title: 'User Form',
|
||||
padding: 5,
|
||||
xtype: 'panel',
|
||||
html: 'Add or select an User'
|
||||
};
|
||||
|
||||
// UserGrid
|
||||
Sonia.user.Grid = Ext.extend(Sonia.rest.Grid, {
|
||||
|
||||
@@ -74,8 +94,6 @@ Sonia.user.Grid = Ext.extend(Sonia.rest.Grid, {
|
||||
if ( debug ){
|
||||
console.debug( item.name + ' selected' );
|
||||
}
|
||||
var editPanel = Ext.getCmp('userEditPanel');
|
||||
editPanel.removeAll();
|
||||
var panel = new Sonia.user.FormPanel({
|
||||
item: item,
|
||||
region: 'south',
|
||||
@@ -94,8 +112,7 @@ Sonia.user.Grid = Ext.extend(Sonia.rest.Grid, {
|
||||
{id: 'password', value: dummyPassword},
|
||||
{id: 'password-confirm', value: dummyPassword}
|
||||
]);
|
||||
editPanel.add(panel);
|
||||
editPanel.doLayout();
|
||||
Sonia.user.setEditPanel(panel);
|
||||
}
|
||||
|
||||
});
|
||||
@@ -211,6 +228,10 @@ Sonia.user.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
|
||||
alert( 'failure' );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
cancel: function(){
|
||||
Sonia.user.setEditPanel( Sonia.user.DefaultPanel );
|
||||
}
|
||||
|
||||
});
|
||||
@@ -282,16 +303,7 @@ Sonia.user.Panel = Ext.extend(Ext.Panel, {
|
||||
},
|
||||
|
||||
resetPanel: function(){
|
||||
var editPanel = Ext.getCmp('userEditPanel');
|
||||
editPanel.removeAll();
|
||||
editPanel.add({
|
||||
region: 'south',
|
||||
title: 'User Form',
|
||||
padding: 5,
|
||||
xtype: 'panel',
|
||||
html: 'Add or select an User'
|
||||
});
|
||||
editPanel.doLayout();
|
||||
Sonia.user.setEditPanel( Sonia.user.DefaultPanel );
|
||||
},
|
||||
|
||||
removeUser: function(){
|
||||
|
||||
Reference in New Issue
Block a user