fix history bug

This commit is contained in:
Sebastian Sdorra
2011-08-22 15:57:43 +02:00
parent 82e7589538
commit fa03332fe6
2 changed files with 26 additions and 6 deletions

View File

@@ -41,7 +41,12 @@ Sonia.repository.ChangesetViewerPanel = Ext.extend(Ext.Panel, {
changesetViewerTitleText: 'Commits {0}', changesetViewerTitleText: 'Commits {0}',
initComponent: function(){ initComponent: function(){
this.historyId = 'changesetviewer|' + this.repository.id; this.historyId = Sonia.History.createToken([
'changesetviewer',
this.repository.id,
this.start,
this.pageSize
]);
this.changesetStore = new Sonia.rest.JsonStore({ this.changesetStore = new Sonia.rest.JsonStore({
id: 'changesetStore', id: 'changesetStore',

View File

@@ -38,13 +38,28 @@ Sonia.History = {
recentlyChanged: [], recentlyChanged: [],
add: function(token){ add: function(token){
if ( debug ){ if (token != Ext.History.getToken()){
console.debug('add history element ' + token); if (this.isInvokeable(this.recentlyChanged, token)){
if ( debug ){
console.debug('add history element ' + token);
}
this.recentlyAdded.push(token);
Ext.History.add(token, true);
}
} }
if (this.isInvokeable(this.recentlyChanged, token)){ },
this.recentlyAdded.push(token);
Ext.History.add(token, true); createToken: function(elements){
var token = '';
if (Ext.isArray(elements)){
for (var i=0; i<elements.length; i++){
token += elements[i];
if ( (i+1)<elements.length ){
token += '|';
}
}
} }
return token;
}, },
append: function(item){ append: function(item){