diff --git a/scm-webapp/src/main/webapp/resources/js/sonia.group.js b/scm-webapp/src/main/webapp/resources/js/sonia.group.js
index 31e7b81e9a..4899fd425f 100644
--- a/scm-webapp/src/main/webapp/resources/js/sonia.group.js
+++ b/scm-webapp/src/main/webapp/resources/js/sonia.group.js
@@ -93,13 +93,32 @@ Sonia.group.Grid = Ext.extend(Sonia.rest.Grid, {
autoExpandColumn: 'members',
store: groupStore,
colModel: groupColModel,
- emptyText: this.emptyGroupStoreText
+ emptyText: this.emptyGroupStoreText,
+ listeners: {
+ fallBelowMinHeight: {
+ fn: this.onFallBelowMinHeight,
+ scope: this
+ }
+ }
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
Sonia.group.Grid.superclass.initComponent.apply(this, arguments);
},
+
+ onFallBelowMinHeight: function(height, minHeight){
+ var p = Ext.getCmp('groupEditPanel');
+ this.setHeight(minHeight);
+ var epHeight = p.getHeight();
+ p.setHeight(epHeight - (minHeight - height));
+ // rerender
+ this.doLayout();
+ p.doLayout();
+ this.ownerCt.doLayout();
+ },
+
+
renderMembers: function(members){
var out = '';
if ( members != null ){
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 4e7c5e736f..6556399c08 100644
--- a/scm-webapp/src/main/webapp/resources/js/sonia.repository.js
+++ b/scm-webapp/src/main/webapp/resources/js/sonia.repository.js
@@ -132,13 +132,30 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, {
autoExpandColumn: 'description',
store: repositoryStore,
colModel: repositoryColModel,
- emptyText: this.emptyText
+ emptyText: this.emptyText,
+ listeners: {
+ fallBelowMinHeight: {
+ fn: this.onFallBelowMinHeight,
+ scope: this
+ }
+ }
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
Sonia.repository.Grid.superclass.initComponent.apply(this, arguments);
},
+ onFallBelowMinHeight: function(height, minHeight){
+ var p = Ext.getCmp('repositoryEditPanel');
+ this.setHeight(minHeight);
+ var epHeight = p.getHeight();
+ p.setHeight(epHeight - (minHeight - height));
+ // rerender
+ this.doLayout();
+ p.doLayout();
+ this.ownerCt.doLayout();
+ },
+
selectItem: function(item){
if ( debug ){
console.debug( item.name + ' selected' );
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 80eb28b7dd..7e4454a7e8 100644
--- a/scm-webapp/src/main/webapp/resources/js/sonia.rest.js
+++ b/scm-webapp/src/main/webapp/resources/js/sonia.rest.js
@@ -75,6 +75,7 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, {
mailtoTemplate: '{0}',
checkboxTemplate: '',
emptyText: 'No items available',
+ minHeight: 150,
initComponent: function(){
@@ -90,7 +91,7 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, {
});
var config = {
- minHeight: 150,
+ minHeight: this.minHeight,
loadMask: true,
sm: selectionModel,
viewConfig: {
@@ -99,6 +100,10 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, {
}
};
+ this.addEvents('fallBelowMinHeight');
+
+ Ext.EventManager.onWindowResize(this.resize, this);
+
Ext.apply(this, Ext.apply(this.initialConfig, config));
Sonia.rest.Grid.superclass.initComponent.apply(this, arguments);
@@ -109,6 +114,24 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, {
this.store.load();
},
+ resize: function(){
+ var h = this.getHeight();
+ if (debug){
+ console.debug('' + h + ' < ' + this.minHeight + " = " + (h < this.minHeight));
+ }
+ if ( h < this.minHeight ){
+ if ( debug ){
+ console.debug( 'fire event fallBelowMinHeight' );
+ }
+ this.fireEvent('fallBelowMinHeight', h, this.minHeight);
+ }
+ },
+
+ onDestroy: function(){
+ Ext.EventManager.removeResizeListener(this.resize, this);
+ Sonia.rest.Grid.superclass.onDestroy.apply(this, arguments);
+ },
+
reload: function(){
if ( debug ){
console.debug('reload store');
diff --git a/scm-webapp/src/main/webapp/resources/js/sonia.user.js b/scm-webapp/src/main/webapp/resources/js/sonia.user.js
index 19cbd566a1..6822df5aa3 100644
--- a/scm-webapp/src/main/webapp/resources/js/sonia.user.js
+++ b/scm-webapp/src/main/webapp/resources/js/sonia.user.js
@@ -99,13 +99,30 @@ Sonia.user.Grid = Ext.extend(Sonia.rest.Grid, {
var config = {
store: userStore,
- colModel: userColModel
+ colModel: userColModel,
+ listeners: {
+ fallBelowMinHeight: {
+ fn: this.onFallBelowMinHeight,
+ scope: this
+ }
+ }
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
Sonia.user.Grid.superclass.initComponent.apply(this, arguments);
},
+ onFallBelowMinHeight: function(height, minHeight){
+ var p = Ext.getCmp('userEditPanel');
+ this.setHeight(minHeight);
+ var epHeight = p.getHeight();
+ p.setHeight(epHeight - (minHeight - height));
+ // rerender
+ this.doLayout();
+ p.doLayout();
+ this.ownerCt.doLayout();
+ },
+
selectItem: function(item){
if ( debug ){
console.debug( item.name + ' selected' );