mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-06 07:15:53 +02:00
added util method to open files
This commit is contained in:
@@ -159,26 +159,8 @@ Sonia.repository.CommitPanel = Ext.extend(Ext.Panel, {
|
||||
},
|
||||
|
||||
openFile: function(path){
|
||||
if ( debug ){
|
||||
console.debug( 'open file: ' + path );
|
||||
}
|
||||
|
||||
var id = Sonia.repository.createContentId(
|
||||
this.repository,
|
||||
path,
|
||||
this.revision
|
||||
);
|
||||
|
||||
main.addTab({
|
||||
id: id,
|
||||
path: path,
|
||||
revision: this.revision,
|
||||
repository: this.repository,
|
||||
xtype: 'contentPanel',
|
||||
closable: true,
|
||||
autoScroll: true
|
||||
});
|
||||
},
|
||||
Sonia.repository.openFile(this.repository, path, this.revision);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -189,4 +189,27 @@ Sonia.repository.get = function(id, callback){
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/** open file */
|
||||
Sonia.repository.openFile = function(repository, path, revision){
|
||||
if ( debug ){
|
||||
console.debug( 'open file: ' + path );
|
||||
}
|
||||
|
||||
var id = Sonia.repository.createContentId(
|
||||
repository,
|
||||
path,
|
||||
revision
|
||||
);
|
||||
|
||||
main.addTab({
|
||||
id: id,
|
||||
path: path,
|
||||
revision: revision,
|
||||
repository: repository,
|
||||
xtype: 'contentPanel',
|
||||
closable: true,
|
||||
autoScroll: true
|
||||
});
|
||||
};
|
||||
@@ -339,25 +339,7 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, {
|
||||
},
|
||||
|
||||
openFile: function(path){
|
||||
if ( debug ){
|
||||
console.debug( 'open file: ' + path );
|
||||
}
|
||||
|
||||
var id = Sonia.repository.createContentId(
|
||||
this.repository,
|
||||
path,
|
||||
this.revision
|
||||
);
|
||||
|
||||
main.addTab({
|
||||
id: id,
|
||||
path: path,
|
||||
revision: this.revision,
|
||||
repository: this.repository,
|
||||
xtype: 'contentPanel',
|
||||
closable: true,
|
||||
autoScroll: true
|
||||
});
|
||||
Sonia.repository.openFile(this.repository, path, this.revision);
|
||||
},
|
||||
|
||||
changeDirectory: function(path){
|
||||
|
||||
Reference in New Issue
Block a user