mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
make scm-manager bookmarkable
This commit is contained in:
@@ -33,11 +33,13 @@ Ext.ns('Sonia');
|
|||||||
|
|
||||||
Sonia.History = {
|
Sonia.History = {
|
||||||
|
|
||||||
|
initialized: false,
|
||||||
historyElements: [],
|
historyElements: [],
|
||||||
recentlyAdded: [],
|
recentlyAdded: [],
|
||||||
recentlyChanged: [],
|
recentlyChanged: [],
|
||||||
|
|
||||||
add: function(token){
|
add: function(token){
|
||||||
|
if (this.initialized){
|
||||||
if (token != Ext.History.getToken()){
|
if (token != Ext.History.getToken()){
|
||||||
if (this.isInvokeable(this.recentlyChanged, token)){
|
if (this.isInvokeable(this.recentlyChanged, token)){
|
||||||
if ( debug ){
|
if ( debug ){
|
||||||
@@ -47,6 +49,7 @@ Sonia.History = {
|
|||||||
Ext.History.add(token, true);
|
Ext.History.add(token, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
createToken: function(elements){
|
createToken: function(elements){
|
||||||
@@ -116,6 +119,9 @@ Sonia.History = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onChange: function(token){
|
onChange: function(token){
|
||||||
|
if (!this.initialized){
|
||||||
|
this.initialized = true;
|
||||||
|
}
|
||||||
if(token){
|
if(token){
|
||||||
if (this.isInvokeable(this.recentlyAdded, token)){
|
if (this.isInvokeable(this.recentlyAdded, token)){
|
||||||
var parts = token.split('|');
|
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){
|
Ext.History.on('change', function(token){
|
||||||
Sonia.History.onChange(token);
|
Sonia.History.onChange(token);
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user