-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Fix #1633. Add scroll to top plugin * fixed docs * Fixed version and empty line
- Loading branch information
1 parent
b8a360c
commit 32f341d
Showing
9 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2017, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
const React = require('react'); | ||
const ScrollUp = require('react-scroll-up'); | ||
const Message = require('../components/I18N/Message'); | ||
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 | ||
* @memberof plugins | ||
* @class | ||
* @static | ||
*/ | ||
const ScrollTop = React.createClass({ | ||
propTypes: { | ||
style: React.PropTypes.object, | ||
showUnder: React.PropTypes.number | ||
}, | ||
getDefaultProps() { | ||
return { | ||
showUnder: 200, | ||
style: { | ||
zIndex: 10, | ||
position: 'fixed', | ||
bottom: 50, | ||
right: 30, | ||
cursor: 'pointer', | ||
transitionDuration: '0.2s', | ||
transitionTimingFunction: 'linear', | ||
transitionDelay: '0s' | ||
} | ||
}; | ||
}, | ||
render() { | ||
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> | ||
</OverlayTrigger> | ||
</ScrollUp>); | ||
} | ||
}); | ||
|
||
|
||
module.exports = { | ||
ScrollTopPlugin: ScrollTop | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters