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

View File

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