mirror of
https://github.com/wassname/talk.git
synced 2026-07-10 20:37:29 +08:00
Merge branch 'formatting' of github.com:coralproject/talk into formatting
* 'formatting' of github.com:coralproject/talk: prettier End of line More syncs Fix deselect bug of action menu in ff
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Button, Icon } from 'coral-ui';
|
||||
import ClickOutside from 'coral-framework/components/ClickOutside';
|
||||
import { Menu } from 'react-mdl';
|
||||
import cn from 'classnames';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
@@ -34,30 +35,39 @@ class ActionsMenu extends React.Component {
|
||||
render() {
|
||||
const { className = '', buttonClassNames = '', label = '' } = this.props;
|
||||
return (
|
||||
<div className={cn(styles.root, className)} onBlur={this.syncOpenState}>
|
||||
<Button
|
||||
cStyle="actions"
|
||||
className={cn(
|
||||
styles.button,
|
||||
{ [styles.buttonOpen]: this.state.open },
|
||||
buttonClassNames
|
||||
)}
|
||||
disabled={false}
|
||||
id={this.id}
|
||||
<ClickOutside onClickOutside={this.syncOpenState}>
|
||||
<div
|
||||
className={cn(styles.root, className)}
|
||||
onBlur={this.syncOpenState}
|
||||
onClick={this.syncOpenState}
|
||||
icon={this.props.icon}
|
||||
raised
|
||||
onKeyUp={this.syncOpenState}
|
||||
>
|
||||
{label ? label : t('modqueue.actions')}
|
||||
<Icon
|
||||
name={this.state.open ? 'keyboard_arrow_up' : 'keyboard_arrow_down'}
|
||||
className={styles.arrowIcon}
|
||||
/>
|
||||
</Button>
|
||||
<Menu target={this.id} className={styles.menu} ref={this.handleRef}>
|
||||
{this.props.children}
|
||||
</Menu>
|
||||
</div>
|
||||
<Button
|
||||
cStyle="actions"
|
||||
className={cn(
|
||||
styles.button,
|
||||
{ [styles.buttonOpen]: this.state.open },
|
||||
buttonClassNames
|
||||
)}
|
||||
disabled={false}
|
||||
id={this.id}
|
||||
onClick={this.syncOpenState}
|
||||
icon={this.props.icon}
|
||||
raised
|
||||
>
|
||||
{label ? label : t('modqueue.actions')}
|
||||
<Icon
|
||||
name={
|
||||
this.state.open ? 'keyboard_arrow_up' : 'keyboard_arrow_down'
|
||||
}
|
||||
className={styles.arrowIcon}
|
||||
/>
|
||||
</Button>
|
||||
<Menu target={this.id} className={styles.menu} ref={this.handleRef}>
|
||||
{this.props.children}
|
||||
</Menu>
|
||||
</div>
|
||||
</ClickOutside>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user