From f37db06719ff2712c2189bcb73db990a430ea5c0 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Thu, 23 Jun 2011 21:37:09 +0200 Subject: [PATCH] added information toolbar to file panel --- .../sonia.repository.repositorybrowser.js | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.repositorybrowser.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.repositorybrowser.js index 6fdc211d29..2172f1848e 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.repositorybrowser.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.repositorybrowser.js @@ -106,15 +106,8 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { }] }); - var bItems = [ - this.createFolderButton('', ''), - '->', - this.repository.name - ]; - - if ( this.revision != null ){ - bItems.push(': ', this.revision); - } + var bItems = [this.createFolderButton('', '')]; + this.appendRepositoryProperties(bItems); var config = { bbar: { @@ -204,6 +197,13 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { return ext; }, + appendRepositoryProperties: function(bar){ + bar.push('->',this.repository.name); + if ( this.revision != null ){ + bar.push(': ', this.revision); + } + }, + openFile: function(path){ if ( debug ){ console.debug( 'open file: ' + path ); @@ -216,6 +216,9 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { url += "&revision=" + this.revision; } + var bar = [path]; + this.appendRepositoryProperties(bar); + main.addTab({ id: this.repository.id + "-b-" + path, contentUrl: url, @@ -223,7 +226,8 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, { title: this.getName(path), closable: true, autoScroll: true, - syntax: ext + syntax: ext, + bbar: bar }); },