fix repository selection by history

This commit is contained in:
Sebastian Sdorra
2012-04-01 13:02:54 +02:00
parent 58d6fdedcc
commit 21eeaae4d9
2 changed files with 17 additions and 2 deletions

View File

@@ -48,6 +48,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, {
// for history
parentPanel: null,
ready: false,
initComponent: function(){
@@ -218,6 +219,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, {
if (this.searchValue){
this.filterStore();
}
this.ready = true;
},
onFallBelowMinHeight: function(height, minHeight){

View File

@@ -292,6 +292,14 @@ Sonia.History.register('repositoryPanel', {
return token;
},
waitAndSelect: function(grid, repoId){
setTimeout(function(){
if ( grid.ready ){
grid.selectById(repoId);
}
}, 250);
},
onChange: function(repoId){
var panel = Ext.getCmp('repositories');
if ( ! panel ){
@@ -308,8 +316,13 @@ Sonia.History.register('repositoryPanel', {
}
} else {
main.addTab(panel);
if (repoId){
panel.getGrid().selectById(repoId);
if ( repoId ){
var grid = panel.getGrid();
if ( grid.ready ){
grid.selectById(repoId);
} else {
this.waitAndSelect(grid, repoId);
}
}
}
}