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

Use square button for ScrollTop plugin #1657

Merged
merged 1 commit into from
Mar 29, 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
11 changes: 7 additions & 4 deletions web/client/plugins/ScrollTop.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@ const {Glyphicon, Button, OverlayTrigger, Tooltip} = require('react-bootstrap');

/**
* ScrollUp Plugin. Show a button that allows to scroll to the top of the page. Only for full pages.
* @prop style {object} the style of the scrollUp div
* @prop showUnder {number} pixels of scroll before to show the button
* @prop cfg.style {object} the style of the scrollUp div
* @prop cfg.btnClassName {string} the class to set for the button
* @prop cfg.showUnder {number} pixels of scroll before to show the button. Default 200
* @memberof plugins
* @class
* @static
*/
const ScrollTop = React.createClass({
propTypes: {
style: React.PropTypes.object,
showUnder: React.PropTypes.number
showUnder: React.PropTypes.number,
btnClassName: React.PropTypes.string
},
getDefaultProps() {
return {
showUnder: 200,
btnClassName: 'square-button',
style: {
zIndex: 10,
position: 'fixed',
Expand All @@ -42,7 +45,7 @@ const ScrollTop = React.createClass({
return (
<ScrollUp style={this.props.style} showUnder={this.props.showUnder}>
<OverlayTrigger placement="left" overlay={<Tooltip><Message msgId="home.scrollTop"/></Tooltip>}>
<Button bsStyle="primary"><Glyphicon glyph="arrow-up"/></Button>
<Button bsStyle="primary" className={this.props.btnClassName}><Glyphicon glyph="arrow-up"/></Button>
</OverlayTrigger>
</ScrollUp>);
}
Expand Down