diff --git a/scm-webapp/src/main/webapp/resources/css/style.css b/scm-webapp/src/main/webapp/resources/css/style.css
index 355e8afcbe..deb968f35e 100644
--- a/scm-webapp/src/main/webapp/resources/css/style.css
+++ b/scm-webapp/src/main/webapp/resources/css/style.css
@@ -153,7 +153,7 @@ a.scm-link:hover {
}
.scm-commit {
- margin-bottom: 50px;
+ margin-bottom: 65px;
}
.scm-commit h1 {
diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js
index b711a477d3..52761771ad 100644
--- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js
+++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js
@@ -73,10 +73,16 @@ Sonia.repository.CommitPanel = Ext.extend(Ext.Panel, {
',
templateModifications: '
\n\
- - {.}
\n\
- - {.}
\n\
- - {.}
\n\
-
',
+ \n\
+ {.}\n\
+ \n\
+ \n\
+ {.}\n\
+ \n\
+ \n\
+ {.}\n\
+ \n\
+ ',
// header panel
commitPanel: null,
@@ -84,7 +90,15 @@ Sonia.repository.CommitPanel = Ext.extend(Ext.Panel, {
initComponent: function(){
this.commitPanel = new Ext.Panel({
- tpl: new Ext.XTemplate(this.templateCommit + this.templateModifications)
+ tpl: new Ext.XTemplate(this.templateCommit + this.templateModifications),
+ listeners: {
+ render: {
+ fn: function(panel){
+ panel.body.on('click', this.onClick, this);
+ },
+ scope: this
+ }
+ }
});
this.diffPanel = new Sonia.panel.SyntaxHighlighterPanel({
@@ -132,7 +146,39 @@ Sonia.repository.CommitPanel = Ext.extend(Ext.Panel, {
);
}
});
- }
+ },
+
+ onClick: function(e){
+ var el = e.getTarget('a.scm-link');
+ if (el){
+ var path = el.rel;
+ if (path){
+ this.openFile(path);
+ }
+ }
+ },
+
+ 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
+ });
+ },
});