Re-add bouncing/callout animation to action buttons
This commit is contained in:
parent
548f319816
commit
3185d3ed41
5 changed files with 11 additions and 4 deletions
|
@ -27,6 +27,7 @@ export default React.createClass({
|
|||
size: PropTypes.string,
|
||||
tooltip: PropTypes.bool,
|
||||
action: PropTypes.string.isRequired,
|
||||
mouseOverAction: PropTypes.string,
|
||||
label: PropTypes.string.isRequired,
|
||||
iconPath: PropTypes.string.isRequired,
|
||||
},
|
||||
|
@ -51,6 +52,9 @@ export default React.createClass({
|
|||
|
||||
_onMouseEnter: function() {
|
||||
if (this.props.tooltip) this.setState({showTooltip: true});
|
||||
if (this.props.mouseOverAction) {
|
||||
dis.dispatch({action: this.props.mouseOverAction});
|
||||
}
|
||||
},
|
||||
|
||||
_onMouseLeave: function() {
|
||||
|
|
|
@ -22,6 +22,7 @@ const CreateRoomButton = function(props) {
|
|||
const ActionButton = sdk.getComponent('elements.ActionButton');
|
||||
return (
|
||||
<ActionButton action="view_create_chat"
|
||||
mouseOverAction={props.callout ? "callout_create_room" : null}
|
||||
label="Create new room"
|
||||
iconPath="img/icons-create-room.svg"
|
||||
size={props.size}
|
||||
|
|
|
@ -22,6 +22,7 @@ const RoomDirectoryButton = function(props) {
|
|||
const ActionButton = sdk.getComponent('elements.ActionButton');
|
||||
return (
|
||||
<ActionButton action="view_room_directory"
|
||||
mouseOverAction={props.callout ? "callout_room_directory" : null}
|
||||
label="Room directory"
|
||||
iconPath="img/icons-directory.svg"
|
||||
size={props.size}
|
||||
|
|
|
@ -21,7 +21,8 @@ import PropTypes from 'prop-types';
|
|||
const StartChatButton = function(props) {
|
||||
const ActionButton = sdk.getComponent('elements.ActionButton');
|
||||
return (
|
||||
<ActionButton action="start_chat"
|
||||
<ActionButton action="view_create_chat"
|
||||
mouseOverAction={props.callout ? "callout_start_chat" : null}
|
||||
label="Start chat"
|
||||
iconPath="img/icons-people.svg"
|
||||
size={props.size}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue