Skip to content

Commit 769be56

Browse files
Merge pull request #59 from JakeSidSmith/ellipsize-repo-names
Ellipsize repo names
2 parents 23d0309 + 6a156c8 commit 769be56

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/js/components/repository.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,22 @@ var Repository = React.createClass({
1616
},
1717

1818
render: function () {
19+
var organisationName, repositoryName;
20+
21+
if (typeof this.props.repoName === 'string') {
22+
var splitName = this.props.repoName.split('/');
23+
organisationName = splitName[0];
24+
repositoryName = splitName[1];
25+
}
26+
1927
return (
2028
<div>
2129
<div className='row repository'>
2230
<div className='col-xs-2'><img className='avatar' src={this.getAvatar()} /></div>
23-
<div className='col-xs-10 name' onClick={this.openBrowser}>{this.props.repoName}</div>
31+
<div className='col-xs-10 name' onClick={this.openBrowser}>
32+
<span>{'/' + repositoryName}</span>
33+
<span>{organisationName}</span>
34+
</div>
2435
</div>
2536

2637
{this.props.repo.map(function (obj) {

src/less/style.less

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,15 @@ input {
302302
font-size: 18px;
303303
.FontOpenSansSemibold();
304304
text-align: right;
305+
306+
span {
307+
display: inline-block;
308+
float: right;
309+
max-width: 50%;
310+
white-space: nowrap;
311+
text-overflow: ellipsis;
312+
overflow: hidden;
313+
}
305314
}
306315
}
307316

0 commit comments

Comments
 (0)