Skip to content

Commit

Permalink
Merge pull request #875 from patrykkopycinski/master
Browse files Browse the repository at this point in the history
[#823] Title in AppBar disappears
  • Loading branch information
hai-cea committed Jun 18, 2015
2 parents 539910e + 63eee72 commit feae9b1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/app-bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,16 @@ var AppBar = React.createClass({
root: {
zIndex: 5,
width: '100%',
display: '-webkit-box; display: flex',
minHeight: themeVariables.height,
backgroundColor: themeVariables.color,
paddingLeft: spacing.desktopGutter,
paddingRight: spacing.desktopGutter
},
title: {
float: 'left',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
margin: 0,
paddingTop: 0,
letterSpacing: 0,
Expand All @@ -66,10 +69,13 @@ var AppBar = React.createClass({
color: themeVariables.textColor,
lineHeight: themeVariables.height + 'px'
},
mainElement: {
boxFlex: 1,
flex: '1'
},
iconButton: {
style: {
marginTop: (themeVariables.height - iconButtonSize) / 2,
float: 'left',
marginRight: 8,
marginLeft: -16
},
Expand All @@ -89,7 +95,6 @@ var AppBar = React.createClass({
var menuElementLeft;
var menuElementRight;
var iconRightStyle = this.mergeAndPrefix(styles.iconButton.style, {
float: 'right',
marginRight: -16,
marginLeft: 8
}, this.props.iconStyleRight);
Expand All @@ -98,8 +103,8 @@ var AppBar = React.createClass({
// If the title is a string, wrap in an h1 tag.
// If not, just use it as a node.
title = Object.prototype.toString.call(this.props.title) === '[object String]' ?
<h1 style={this.mergeAndPrefix(styles.title)}>{this.props.title}</h1> :
this.props.title;
<h1 style={this.mergeAndPrefix(styles.title, styles.mainElement)}>{this.props.title}</h1> :
<div style={this.mergeAndPrefix(styles.mainElement)}>{this.props.title}</div>;
}

if (this.props.showMenuIconButton) {
Expand Down

0 comments on commit feae9b1

Please sign in to comment.