From 832fbcb1056b8ec392943d9393439582eff1174e Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Sun, 5 Sep 2010 19:28:54 +0200 Subject: [PATCH] improve debug message --- scm-webapp/src/main/webapp/resources/js/sonia.rest.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scm-webapp/src/main/webapp/resources/js/sonia.rest.js b/scm-webapp/src/main/webapp/resources/js/sonia.rest.js index 107ec7bb2b..b2ee8a3867 100644 --- a/scm-webapp/src/main/webapp/resources/js/sonia.rest.js +++ b/scm-webapp/src/main/webapp/resources/js/sonia.rest.js @@ -182,10 +182,6 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, { if ( this.selModel.hasSelection() ){ var id = this.selModel.getSelected().data[this.idField]; - if ( debug ){ - console.debug( 'remove item ' + id ); - } - var store = this.store; var url = String.format( this.restRemoveUrlPattern, id ); @@ -195,6 +191,11 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, { buttons: Ext.MessageBox.OKCANCEL, icon: Ext.MessageBox.QUESTION, fn: function(result){ + + if ( debug ){ + console.debug( 'remove item ' + id ); + } + if ( result == 'ok' ){ Ext.Ajax.request({ url: url, @@ -207,6 +208,7 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, { } }); } + } });