diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-03-10 21:17:24 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-03-10 21:17:24 +0100 |
commit | 448d28e2cbe5020f97bccc80e9a7e1e5a3df9990 (patch) | |
tree | 8eae7351b1ef8d4f2eea4b34628e5d54908767bc /web/src/js/components/common.js | |
parent | 167bd7768346a75910ca0d3828d02a16887de090 (diff) | |
parent | 4a6edd92e661fa228f6f8607f045ef5489f58a05 (diff) | |
download | mitmproxy-448d28e2cbe5020f97bccc80e9a7e1e5a3df9990.tar.gz mitmproxy-448d28e2cbe5020f97bccc80e9a7e1e5a3df9990.tar.bz2 mitmproxy-448d28e2cbe5020f97bccc80e9a7e1e5a3df9990.zip |
Merge branch 'master' of https://github.com/mitmproxy/mitmproxy
Diffstat (limited to 'web/src/js/components/common.js')
-rw-r--r-- | web/src/js/components/common.js | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/web/src/js/components/common.js b/web/src/js/components/common.js index 447e6eec..ad97ab38 100644 --- a/web/src/js/components/common.js +++ b/web/src/js/components/common.js @@ -2,34 +2,6 @@ import React from "react" import ReactDOM from "react-dom" import _ from "lodash" -// http://blog.vjeux.com/2013/javascript/scroll-position-with-react.html (also contains inverse example) -export var AutoScrollMixin = { - componentWillUpdate: function () { - var node = ReactDOM.findDOMNode(this); - this._shouldScrollBottom = ( - node.scrollTop !== 0 && - node.scrollTop + node.clientHeight === node.scrollHeight - ); - }, - componentDidUpdate: function () { - if (this._shouldScrollBottom) { - var node = ReactDOM.findDOMNode(this); - node.scrollTop = node.scrollHeight; - } - } -}; - - -export var StickyHeadMixin = { - adjustHead: function () { - // Abusing CSS transforms to set the element - // referenced as head into some kind of position:sticky. - var head = ReactDOM.findDOMNode(this.refs.head); - head.style.transform = "translate(0," + ReactDOM.findDOMNode(this).scrollTop + "px)"; - } -}; - - export var Router = { contextTypes: { location: React.PropTypes.object, @@ -53,9 +25,6 @@ export var Router = { // For whatever reason, react-router always returns the same object, which makes comparing // the current props with nextProps impossible. As a workaround, we just clone the query object. return _.clone(this.context.location.query); - }, - getParams: function() { - return this.props.routeParams; } }; |