mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-23 07:52:13 +01:00
mask form on load
This commit is contained in:
@@ -23,34 +23,39 @@ registerConfigPanel({
|
||||
}],
|
||||
|
||||
onSubmit: function(values){
|
||||
this.el.mask('Submit ...');
|
||||
Ext.Ajax.request({
|
||||
url: restUrl + 'config/repositories/hg.json',
|
||||
method: 'POST',
|
||||
jsonData: values,
|
||||
scope: this,
|
||||
disableCaching: true,
|
||||
success: function(response){
|
||||
alert( 'success' );
|
||||
this.el.unmask();
|
||||
},
|
||||
failure: function(){
|
||||
alert( 'failure' );
|
||||
this.el.unmask();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onLoad: function(){
|
||||
//this.getEl().mask();
|
||||
onLoad: function(el){
|
||||
var tid = setTimeout( function(){ el.mask('Loading ...'); }, 100);
|
||||
Ext.Ajax.request({
|
||||
url: restUrl + 'config/repositories/hg.json',
|
||||
method: 'GET',
|
||||
scope: this,
|
||||
disableCaching: true,
|
||||
success: function(response){
|
||||
var obj = Ext.decode(response.responseText);
|
||||
this.load(obj);
|
||||
//this.getEl().unmask();
|
||||
clearTimeout(tid);
|
||||
el.unmask();
|
||||
},
|
||||
failure: function(){
|
||||
alert( 'failure' );
|
||||
//this.getEl().unmask();
|
||||
el.unmask();
|
||||
clearTimeout(tid);
|
||||
alert('failure');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -61,6 +61,14 @@ Sonia.config.ConfigForm = Ext.extend(Ext.form.FormPanel, {
|
||||
layoutConfig : {
|
||||
labelSeparator : ''
|
||||
},
|
||||
listeners: {
|
||||
render: function(){
|
||||
if ( this.onLoad != null && Ext.isFunction( this.onLoad ) ){
|
||||
this.onLoad(this.el);
|
||||
}
|
||||
},
|
||||
scope: this
|
||||
},
|
||||
items: this.items,
|
||||
buttons: [{
|
||||
text: 'Save',
|
||||
@@ -78,14 +86,13 @@ Sonia.config.ConfigForm = Ext.extend(Ext.form.FormPanel, {
|
||||
|
||||
Ext.apply(this, Ext.apply(this.initialConfig, config));
|
||||
Sonia.config.ConfigForm.superclass.initComponent.apply(this, arguments);
|
||||
|
||||
if ( this.onLoad != null && Ext.isFunction( this.onLoad ) ){
|
||||
this.onLoad();
|
||||
}
|
||||
},
|
||||
|
||||
load: function(values){
|
||||
this.getForm().loadRecord({success: true, data: values});
|
||||
this.getForm().loadRecord({
|
||||
success: true,
|
||||
data: values
|
||||
});
|
||||
},
|
||||
|
||||
submitForm: function(){
|
||||
|
||||
Reference in New Issue
Block a user