aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/common.js
diff options
context:
space:
mode:
authorJason <jason.daurus@gmail.com>2016-03-10 21:40:07 +0800
committerJason <jason.daurus@gmail.com>2016-03-10 21:40:07 +0800
commit1c0496e051d8b1af297138732475b1689ada5eb8 (patch)
tree7a2134ac48cce29694313e5a5b3105f2cf7e93ff /web/src/js/components/common.js
parentb413a052f96896d387f58e903203cf2e29c6f1f6 (diff)
downloadmitmproxy-1c0496e051d8b1af297138732475b1689ada5eb8.tar.gz
mitmproxy-1c0496e051d8b1af297138732475b1689ada5eb8.tar.bz2
mitmproxy-1c0496e051d8b1af297138732475b1689ada5eb8.zip
[web] VirtualScroll and AutoScroll helper
Diffstat (limited to 'web/src/js/components/common.js')
-rw-r--r--web/src/js/components/common.js28
1 files changed, 0 insertions, 28 deletions
diff --git a/web/src/js/components/common.js b/web/src/js/components/common.js
index 23e0a434..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,