added debug mode

This commit is contained in:
Sebastian Sdorra
2010-09-05 16:41:28 +02:00
parent a8eb96e06a
commit 2973b80a6b
3 changed files with 19 additions and 5 deletions

View File

@@ -9,7 +9,6 @@ var addGroupWindow = null;
/** Sonia.GroupGrid **/
function addGroup(){
console.debug( 'add group' );
addGroupWindow = new Sonia.group.DetailWindow();
addGroupWindow.show();
}
@@ -17,7 +16,10 @@ function addGroup(){
function removeGroup(){
if (groupSelModel.hasSelection()){
var group = groupSelModel.getSelected().data.name;
console.debug( 'remove group ' + group );
if ( debug ){
console.debug( 'remove group ' + group );
}
Ext.MessageBox.show({
title: 'Remove Group',
@@ -78,7 +80,9 @@ var groupToolbar = new Ext.Toolbar({
specialkey: function(field, e){
if (e.getKey() == e.ENTER) {
var value = this.getValue();
console.log( 'Filter: ' + value );
if ( debug ){
console.log( 'Filter: ' + value );
}
// TODO filter by member
groupStore.filter('name', new RegExp('.*' + value + '.*'));
}
@@ -276,6 +280,11 @@ Sonia.group.AddForm = new Ext.extend(Ext.FormPanel, {
url = restUrl + 'groups.json';
}
if ( debug ){
var action = this.update ? 'edit' : 'add';
console.debug( action + ' group ' + name );
}
Ext.Ajax.request({
url: url,
jsonData: group,