Skip to content

Commit

Permalink
Use square button for ScrollTop plugin
Browse files Browse the repository at this point in the history
 - Now scrollTop button has the "square-button"class by default. The class can be changed via configuration.
  • Loading branch information
offtherailz committed Mar 29, 2017
1 parent 65287ac commit 0634f6d
Showing 1 changed file with 7 additions and 4 deletions.
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

0 comments on commit 0634f6d

Please sign in to comment.