added loading mask to repository creation

This commit is contained in:
Sebastian Sdorra
2010-11-23 17:41:50 +01:00
parent 753de21a63
commit f79812bf3d

View File

@@ -162,6 +162,8 @@ Sonia.repository.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
console.debug( 'update repository: ' + item.name );
}
var url = restUrl + 'repositories/' + item.id + '.json';
var el = this.el;
var tid = setTimeout( function(){ el.mask('Loading ...'); }, 100);
Ext.Ajax.request({
url: url,
jsonData: item,
@@ -171,9 +173,13 @@ Sonia.repository.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
if ( debug ){
console.debug('update success');
}
clearTimeout(tid);
el.unmask();
this.execCallback(this.onUpdate, item);
},
failure: function(){
clearTimeout(tid);
el.unmask();
alert( 'failure' );
}
});
@@ -184,6 +190,8 @@ Sonia.repository.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
console.debug( 'create repository: ' + item.name );
}
var url = restUrl + 'repositories.json';
var el = this.el;
var tid = setTimeout( function(){ el.mask('Loading ...'); }, 100);
Ext.Ajax.request({
url: url,
jsonData: item,
@@ -194,9 +202,13 @@ Sonia.repository.FormPanel = Ext.extend(Sonia.rest.FormPanel,{
console.debug('create success');
}
this.getForm().reset();
clearTimeout(tid);
el.unmask();
this.execCallback(this.onCreate, item);
},
failure: function(){
clearTimeout(tid);
el.unmask();
alert( 'failure' );
}
});