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');
11
11
const MenuItem = require ( 'menus/menu-item' ) ;
12
12
const MoreVertIcon = require ( 'svg-icons/navigation/more-vert' ) ;
13
13
14
+ const styles = {
15
+ title : {
16
+ cursor : 'pointer' ,
17
+ } ,
18
+ } ;
19
+
14
20
export default class AppBarPage extends React . Component {
15
21
16
22
constructor ( props ) {
@@ -136,7 +142,7 @@ export default class AppBarPage extends React.Component {
136
142
iconClassNameRight = "muidocs-icon-navigation-expand-more" />
137
143
< br />
138
144
< AppBar
139
- title = " Title"
145
+ title = { < span style = { styles . title } onTouchTap = { this . _onTouchTap } > Title</ span > }
140
146
iconElementLeft = { < IconButton > < NavigationClose /> </ IconButton > }
141
147
iconElementRight = { < FlatButton label = "Save" /> } />
142
148
< br />
@@ -157,4 +163,8 @@ export default class AppBarPage extends React.Component {
157
163
) ;
158
164
}
159
165
166
+ _onTouchTap ( ) {
167
+ alert ( 'onTouchTap triggered on the title component' ) ;
168
+ }
169
+
160
170
}
Original file line number Diff line number Diff line change 3
3
iconClassNameRight="muidocs-icon-navigation-expand-more" />
4
4
5
5
<AppBar
6
- title=" Title"
6
+ title={<span> Title</span>}
7
7
iconElementLeft={<IconButton><NavigationClose /></IconButton>}
8
8
iconElementRight={<FlatButton label="Save" />} />
9
9
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ const AppBar = React.createClass({
164
164
// If not, just use it as a node.
165
165
titleElement = typeof title === 'string' || title instanceof String ?
166
166
< 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 > ;
168
168
}
169
169
170
170
if ( showMenuIconButton ) {
You can’t perform that action at this time.
0 commit comments