mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
create id for content panel
This commit is contained in:
@@ -107,9 +107,13 @@ Sonia.repository.BlamePanel = Ext.extend(Ext.grid.GridPanel, {
|
||||
},
|
||||
|
||||
openContentPanel: function(revision){
|
||||
var id = Sonia.repository.createContentId(
|
||||
this.repository,
|
||||
this.path,
|
||||
revision
|
||||
);
|
||||
main.addTab({
|
||||
// TODO create real id
|
||||
id: Ext.id(),
|
||||
id: id,
|
||||
xtype: 'contentPanel',
|
||||
repository: this.repository,
|
||||
revision: revision,
|
||||
|
||||
@@ -57,6 +57,14 @@ Sonia.repository.createContentUrl = function(repository, path, revision){
|
||||
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){
|
||||
return admin || repository.permissions != null;
|
||||
}
|
||||
|
||||
@@ -221,8 +221,14 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, {
|
||||
console.debug( 'open file: ' + path );
|
||||
}
|
||||
|
||||
var id = Sonia.repository.createContentId(
|
||||
this.repository,
|
||||
path,
|
||||
this.revision
|
||||
);
|
||||
|
||||
main.addTab({
|
||||
id: this.repository.id + "-b-" + path,
|
||||
id: id,
|
||||
path: path,
|
||||
revision: this.revision,
|
||||
repository: this.repository,
|
||||
|
||||
Reference in New Issue
Block a user