File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ const IconMenu = require('menus/icon-menu');
1111const MenuItem = require ( 'menus/menu-item' ) ;
1212const MoreVertIcon = require ( 'svg-icons/navigation/more-vert' ) ;
1313
14+ const styles = {
15+ title : {
16+ cursor : 'pointer' ,
17+ } ,
18+ } ;
19+
1420export default class AppBarPage extends React . Component {
1521
1622 constructor ( props ) {
@@ -136,7 +142,7 @@ export default class AppBarPage extends React.Component {
136142 iconClassNameRight = "muidocs-icon-navigation-expand-more" />
137143 < br />
138144 < AppBar
139- title = " Title"
145+ title = { < span style = { styles . title } onTouchTap = { this . _onTouchTap } > Title</ span > }
140146 iconElementLeft = { < IconButton > < NavigationClose /> </ IconButton > }
141147 iconElementRight = { < FlatButton label = "Save" /> } />
142148 < br />
@@ -157,4 +163,8 @@ export default class AppBarPage extends React.Component {
157163 ) ;
158164 }
159165
166+ _onTouchTap ( ) {
167+ alert ( 'onTouchTap triggered on the title component' ) ;
168+ }
169+
160170}
Original file line number Diff line number Diff line change 33 iconClassNameRight="muidocs-icon-navigation-expand-more" />
44
55<AppBar
6- title=" Title"
6+ title={<span> Title</span>}
77 iconElementLeft={<IconButton><NavigationClose /></IconButton>}
88 iconElementRight={<FlatButton label="Save" />} />
99
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ const AppBar = React.createClass({
164164 // If not, just use it as a node.
165165 titleElement = typeof title === 'string' || title instanceof String ?
166166 < h1 onTouchTap = { this . _onTitleTouchTap } style = { this . prepareStyles ( styles . title , styles . mainElement ) } > { title } </ h1 > :
167- < div onTouchTap = { this . _onTitleTouchTap } style = { this . prepareStyles ( styles . mainElement ) } > { title } </ div > ;
167+ < div onTouchTap = { this . _onTitleTouchTap } style = { this . prepareStyles ( styles . title , styles . mainElement ) } > { title } </ div > ;
168168 }
169169
170170 if ( showMenuIconButton ) {
You can’t perform that action at this time.
0 commit comments