mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-07-07 17:12:29 +02:00
fix repository selection by history
This commit is contained in:
@@ -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){
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user