mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2026-01-05 08:59:15 +00:00
Trying to get it working
This commit is contained in:
@@ -2,7 +2,12 @@ var React = require('react');
|
||||
var Nav = require('naturalcrit/nav/nav.jsx');
|
||||
|
||||
module.exports = function(props){
|
||||
return <Nav.item newTab={true} href='https://github.com/stolksdorf/homebrewery/issues' color='red' icon='fa-bug'>
|
||||
return <Nav.item
|
||||
{...props}
|
||||
newTab={true}
|
||||
href='https://github.com/stolksdorf/homebrewery/issues'
|
||||
color='red'
|
||||
icon='fa-bug'>
|
||||
report issue
|
||||
</Nav.item>
|
||||
};
|
||||
@@ -47,7 +47,7 @@ const NewPage = React.createClass({
|
||||
<Nav.item color='purple' icon='fa-file-pdf-o' onClick={Actions.localPrint}>
|
||||
get PDF
|
||||
</Nav.item>
|
||||
<Items.Issue />
|
||||
<Items.Issue collaspe={true} />
|
||||
<Items.Account />
|
||||
</Nav.section>
|
||||
</Navbar>
|
||||
|
||||
@@ -38,28 +38,29 @@ var Nav = {
|
||||
href : null,
|
||||
newTab : false,
|
||||
onClick : function(){},
|
||||
color : null
|
||||
color : null,
|
||||
collaspe : false
|
||||
};
|
||||
},
|
||||
handleClick : function(){
|
||||
this.props.onClick();
|
||||
},
|
||||
render : function(){
|
||||
var classes = cx('navItem', this.props.color, this.props.className);
|
||||
var classes = cx('navItem', this.props.color, this.props.className, {collaspe : this.props.collaspe});
|
||||
|
||||
var icon;
|
||||
if(this.props.icon) icon = <i className={'fa ' + this.props.icon} />;
|
||||
|
||||
const props = _.omit(this.props, ['newTab']);
|
||||
const props = _.omit(this.props, ['newTab', 'collaspe']);
|
||||
|
||||
if(this.props.href){
|
||||
return <a {...props} className={classes} target={this.props.newTab ? '_blank' : '_self'} >
|
||||
{this.props.children}
|
||||
<span>{this.props.children}</span>
|
||||
{icon}
|
||||
</a>
|
||||
}else{
|
||||
return <div {...props} className={classes} onClick={this.handleClick} >
|
||||
{this.props.children}
|
||||
<span>{this.props.children}</span>
|
||||
{icon}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -49,10 +49,30 @@ nav{
|
||||
color : white;
|
||||
text-decoration : none;
|
||||
text-transform : uppercase;
|
||||
display: inline-block;
|
||||
i{
|
||||
margin-left : 5px;
|
||||
font-size : 13px;
|
||||
}
|
||||
&.collaspe{
|
||||
//width : 60px;
|
||||
overflow: hidden;
|
||||
background-color: red;
|
||||
span{
|
||||
white-space: nowrap;
|
||||
width : 0%;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
&:hover{
|
||||
span{
|
||||
visibility: visible;
|
||||
width : auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.tealLight:hover{ background-color : @tealLight };
|
||||
&.teal:hover{ background-color : @teal };
|
||||
&.greenLight:hover{ background-color : @greenLight };
|
||||
|
||||
Reference in New Issue
Block a user