Hide folders if there are no volumes.

This commit is contained in:
Sean Li 2015-02-16 11:06:39 -08:00
parent bebb2395f9
commit 903c90e997
2 changed files with 16 additions and 8 deletions

View File

@ -17,6 +17,7 @@ var ContainerHomeFolder = React.createClass({
},
render: function () {
var folders;
console.log(_.keys(this.props.container.Volumes));
if (this.props.container) {
var self = this;
folders = _.map(self.props.container.Volumes, function (val, key) {
@ -33,6 +34,7 @@ var ContainerHomeFolder = React.createClass({
}
});
}
if (this.props.container && _.keys(this.props.container.Volumes).length > 0 && this.props.container.State.Running) {
return (
<div className="folders wrapper">
<h4>Edit Files</h4>
@ -42,6 +44,11 @@ var ContainerHomeFolder = React.createClass({
<div className="subtext" onClick={this.handleClickChangeFolders}>Change Folders</div>
</div>
);
} else {
return (
<div></div>
);
}
}
});

View File

@ -150,6 +150,7 @@
position: relative;
top: 0px;
padding: 3px 5px;
text-decoration: underline;
&:hover {
background-color: @brand-action;
color: white;