From f79812bf3d18bfb427bb70524b1315576411478b Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Tue, 23 Nov 2010 17:41:50 +0100 Subject: [PATCH] added loading mask to repository creation --- .../src/main/webapp/resources/js/sonia.repository.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scm-webapp/src/main/webapp/resources/js/sonia.repository.js b/scm-webapp/src/main/webapp/resources/js/sonia.repository.js index 34f59189d0..eb0a650528 100644 --- a/scm-webapp/src/main/webapp/resources/js/sonia.repository.js +++ b/scm-webapp/src/main/webapp/resources/js/sonia.repository.js @@ -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' ); } });