From 512fb22da285979645117999fcdf2d159a98ea23 Mon Sep 17 00:00:00 2001 From: John Haugeland Date: Tue, 10 Nov 2015 19:06:41 -0800 Subject: [PATCH] Adds onTitleTouchTap to AppBar --- docs/src/app/components/pages/components/app-bar.jsx | 6 ++++++ src/app-bar.jsx | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/src/app/components/pages/components/app-bar.jsx b/docs/src/app/components/pages/components/app-bar.jsx index b9b0f3b14907ed..da4bdc7219fda5 100644 --- a/docs/src/app/components/pages/components/app-bar.jsx +++ b/docs/src/app/components/pages/components/app-bar.jsx @@ -103,6 +103,12 @@ export default class AppBarPage extends React.Component { desc: 'Callback function for when the right icon is selected via ' + 'a touch tap.', }, + { + name: 'onTitleTouchTap', + header: 'AppBar.onTitleTouchTap(e)', + desc: 'Callback function for when the title text is selected via ' + + 'a touch tap.', + }, ], }, ]; diff --git a/src/app-bar.jsx b/src/app-bar.jsx index 1457eed4c9c677..8b5f523771ddda 100644 --- a/src/app-bar.jsx +++ b/src/app-bar.jsx @@ -30,6 +30,7 @@ const AppBar = React.createClass({ propTypes: { onLeftIconButtonTouchTap: React.PropTypes.func, onRightIconButtonTouchTap: React.PropTypes.func, + onTitleTouchTap: React.PropTypes.func, showMenuIconButton: React.PropTypes.bool, style: React.PropTypes.object, iconClassNameLeft: React.PropTypes.string, @@ -162,8 +163,8 @@ const AppBar = React.createClass({ // If the title is a string, wrap in an h1 tag. // If not, just use it as a node. titleElement = typeof title === 'string' || title instanceof String ? -

{title}

: -
{title}
; +

{title}

: +
{title}
; } if (showMenuIconButton) { @@ -254,6 +255,12 @@ const AppBar = React.createClass({ } }, + _onTitleTouchTap(event) { + if (this.props.onTitleTouchTap) { + this.props.onTitleTouchTap(event); + } + }, + }); module.exports = AppBar;