create id for content panel

This commit is contained in:
Sebastian Sdorra
2011-09-18 09:57:40 +02:00
parent 89b4646624
commit 66c7c2dc2b
3 changed files with 21 additions and 3 deletions

View File

@@ -107,9 +107,13 @@ Sonia.repository.BlamePanel = Ext.extend(Ext.grid.GridPanel, {
}, },
openContentPanel: function(revision){ openContentPanel: function(revision){
var id = Sonia.repository.createContentId(
this.repository,
this.path,
revision
);
main.addTab({ main.addTab({
// TODO create real id id: id,
id: Ext.id(),
xtype: 'contentPanel', xtype: 'contentPanel',
repository: this.repository, repository: this.repository,
revision: revision, revision: revision,

View File

@@ -57,6 +57,14 @@ Sonia.repository.createContentUrl = function(repository, path, revision){
return contentUrl; return contentUrl;
} }
Sonia.repository.createContentId = function(repository, path, revision){
var id = repository.id + '-b-' + path;
if ( revision ){
id += '-r-' + revision;
}
return id;
}
Sonia.repository.isOwner = function(repository){ Sonia.repository.isOwner = function(repository){
return admin || repository.permissions != null; return admin || repository.permissions != null;
} }

View File

@@ -221,8 +221,14 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, {
console.debug( 'open file: ' + path ); console.debug( 'open file: ' + path );
} }
var id = Sonia.repository.createContentId(
this.repository,
path,
this.revision
);
main.addTab({ main.addTab({
id: this.repository.id + "-b-" + path, id: id,
path: path, path: path,
revision: this.revision, revision: this.revision,
repository: this.repository, repository: this.repository,