From b4a491cd8f42ea46d0a58023c48294698db9f24c Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 17 Jun 2015 17:15:34 +0800 Subject: [PATCH] Add animation for Tooltip --- components/popover/index.jsx | 4 ++-- components/tooltip/index.jsx | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/components/popover/index.jsx b/components/popover/index.jsx index 80b046f068..af003e6b82 100644 --- a/components/popover/index.jsx +++ b/components/popover/index.jsx @@ -4,14 +4,14 @@ var React = require('react'); var Tooltip = require('rc-tooltip'); module.exports = React.createClass({ - getDefaultProps: function () { + getDefaultProps() { return { transitionName: '', placement: 'top', trigger: 'hover' }; }, - render: function() { + render() { var overlay =
{this.props.title} diff --git a/components/tooltip/index.jsx b/components/tooltip/index.jsx index db06f61a3b..9eef744521 100644 --- a/components/tooltip/index.jsx +++ b/components/tooltip/index.jsx @@ -4,16 +4,23 @@ var React = require('react'); var Tooltip = require('rc-tooltip'); module.exports = React.createClass({ - getDefaultProps: function () { + getDefaultProps() { return { placement: 'top' }; }, - render: function() { + render() { + var transitionName = ({ + top: 'zoom-down', + bottom: 'zoom-up', + left: 'zoom-right', + right: 'zoom-left' + })[this.props.placement]; return ( {this.props.children}