mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
make scm-manager bookmarkable
This commit is contained in:
@@ -33,11 +33,13 @@ Ext.ns('Sonia');
|
||||
|
||||
Sonia.History = {
|
||||
|
||||
initialized: false,
|
||||
historyElements: [],
|
||||
recentlyAdded: [],
|
||||
recentlyChanged: [],
|
||||
|
||||
add: function(token){
|
||||
if (this.initialized){
|
||||
if (token != Ext.History.getToken()){
|
||||
if (this.isInvokeable(this.recentlyChanged, token)){
|
||||
if ( debug ){
|
||||
@@ -47,6 +49,7 @@ Sonia.History = {
|
||||
Ext.History.add(token, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
createToken: function(elements){
|
||||
@@ -116,6 +119,9 @@ Sonia.History = {
|
||||
},
|
||||
|
||||
onChange: function(token){
|
||||
if (!this.initialized){
|
||||
this.initialized = true;
|
||||
}
|
||||
if(token){
|
||||
if (this.isInvokeable(this.recentlyAdded, token)){
|
||||
var parts = token.split('|');
|
||||
@@ -147,6 +153,20 @@ Sonia.History = {
|
||||
};
|
||||
|
||||
|
||||
Ext.History.on('ready', function(history){
|
||||
var token = history.getToken();
|
||||
if (!token || token == 'null'){
|
||||
Sonia.History.initialized = true;
|
||||
} else {
|
||||
setTimeout(function(){
|
||||
if (debug){
|
||||
console.debug('history ready, handle history token ' + token);
|
||||
}
|
||||
Sonia.History.onChange(token);
|
||||
}, 750);
|
||||
}
|
||||
});
|
||||
|
||||
Ext.History.on('change', function(token){
|
||||
Sonia.History.onChange(token);
|
||||
});
|
||||
Reference in New Issue
Block a user