Fix raise hand toggled state

This commit is contained in:
yanas
2017-05-26 16:28:16 -05:00
parent ec2e6525ac
commit d1737745c2
7 changed files with 155 additions and 275 deletions

View File

@@ -36,11 +36,6 @@ class Toolbar extends Component {
*/
_onMouseOver: React.PropTypes.func,
/**
* Contains button handlers.
*/
buttonHandlers: React.PropTypes.object,
/**
* Children of current React component.
*/
@@ -77,8 +72,6 @@ class Toolbar extends Component {
constructor(props) {
super(props);
this._setButtonHandlers();
// Bind callbacks to preverse this.
this._renderToolbarButton = this._renderToolbarButton.bind(this);
}
@@ -154,35 +147,6 @@ class Toolbar extends Component {
return acc;
}
/**
* Sets handlers for some of the buttons.
*
* @private
* @returns {void}
*/
_setButtonHandlers(): void {
const {
buttonHandlers,
toolbarButtons
} = this.props;
// Only a few buttons have buttonHandlers defined, so it may be
// undefined or empty depending on the buttons rendered.
// TODO Merge the buttonHandlers and onClick properties and come up with
// a consistent event handling property.
buttonHandlers && Object.keys(buttonHandlers).forEach(key => {
let button = toolbarButtons.get(key);
if (button) {
button = {
...button,
...buttonHandlers[key]
};
toolbarButtons.set(key, button);
}
});
}
}
/**