Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified renderButtons() in drawer/Menu.jsx (issue 1526) #1527

Merged
merged 6 commits into from
Mar 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions web/client/plugins/drawer/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
* LICENSE file in the root directory of this source tree.
*/
var React = require('react');
var {Glyphicon, Button} = require('react-bootstrap');
var {Glyphicon, Button, OverlayTrigger, Tooltip} = require('react-bootstrap');
var Sidebar = require('react-sidebar').default;
var Message = require('../../components/I18N/Message');

var Menu = React.createClass({
propTypes: {
Expand Down Expand Up @@ -58,11 +59,18 @@ var Menu = React.createClass({
);
},
renderButtons() {
return this.props.children.map((child) => (
<Button key={child.props.eventKey} bsSize="large" className={(child.props.buttonConfig && child.props.buttonConfig.buttonClassName) ? child.props.buttonConfig.buttonClassName : "square-button"} onClick={this.props.onChoose.bind(null, child.props.eventKey)} bsStyle={this.props.activeKey === child.props.eventKey ? 'default' : 'primary'}>
{child.props.glyph ? <Glyphicon glyph={child.props.glyph} /> : child.props.icon}
</Button>
));
return this.props.children.map((child) => {
const button = (<Button key={child.props.eventKey} bsSize="large" className={(child.props.buttonConfig && child.props.buttonConfig.buttonClassName) ? child.props.buttonConfig.buttonClassName : "square-button"} onClick={this.props.onChoose.bind(null, child.props.eventKey)} bsStyle={this.props.activeKey === child.props.eventKey ? 'default' : 'primary'}>
{child.props.glyph ? <Glyphicon glyph={child.props.glyph} /> : child.props.icon}
</Button>);
const tooltip = <Tooltip key={"tooltip." + child.props.eventKey} id={"tooltip." + child.props.eventKey}><Message msgId={child.props.buttonConfig.tooltip}/></Tooltip>;
return child.props.buttonConfig.tooltip ? (
<OverlayTrigger placement={"bottom"} key={"overlay-trigger." + child.props.eventKey}
overlay={tooltip}>
{button}
</OverlayTrigger>
) : button;
});
},
renderContent() {
const header = this.props.single ? (
Expand Down