diff --git a/scm-webapp/src/main/webapp/resources/js/sonia.history.js b/scm-webapp/src/main/webapp/resources/js/sonia.history.js index b1d6eae314..6a817f8542 100644 --- a/scm-webapp/src/main/webapp/resources/js/sonia.history.js +++ b/scm-webapp/src/main/webapp/resources/js/sonia.history.js @@ -49,21 +49,31 @@ Sonia.History = { } }, - register: function(id, fn){ - this.historyElements.push({ - 'id': id, - 'fn': fn - }); + register: function(id, fn, scope){ + if (scope){ + this.historyElements[id] = { + 'fn': fn, + 'scope': scope + }; + } else { + this.historyElements[id] = fn; + } + }, handleChange: function(id, params){ - if ( debug ){ - console.debug( 'handle ' + id + ' with "' + params + '"' ); - } - for (var i=0; i