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