aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/common.js
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-05-27 11:43:01 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-05-27 11:43:01 -0700
commitabf3cae54e715e53559b4c7103f8b2247ed791dc (patch)
tree765b55027aba7685264e838d285c0587d18b9205 /web/src/js/components/common.js
parent22ecd022a84e1c3762dd425bc9bee2230e393d8d (diff)
parent9e869f0aa17cbd202f72bab1540d866f7274a8a1 (diff)
downloadmitmproxy-abf3cae54e715e53559b4c7103f8b2247ed791dc.tar.gz
mitmproxy-abf3cae54e715e53559b4c7103f8b2247ed791dc.tar.bz2
mitmproxy-abf3cae54e715e53559b4c7103f8b2247ed791dc.zip
Merge pull request #1169 from gzzhanghao/contentview
[web] Eliminate Router mixin and RawMixin
Diffstat (limited to 'web/src/js/components/common.js')
-rw-r--r--web/src/js/components/common.js28
1 files changed, 1 insertions, 27 deletions
diff --git a/web/src/js/components/common.js b/web/src/js/components/common.js
index 21ca454f..b257b82c 100644
--- a/web/src/js/components/common.js
+++ b/web/src/js/components/common.js
@@ -2,32 +2,6 @@ import React from "react"
import ReactDOM from "react-dom"
import _ from "lodash"
-export var Router = {
- contextTypes: {
- location: React.PropTypes.object,
- router: React.PropTypes.object.isRequired
- },
- updateLocation: function (pathname, queryUpdate) {
- if (pathname === undefined) {
- pathname = this.context.location.pathname;
- }
- var query = this.context.location.query;
- if (queryUpdate !== undefined) {
- for (var i in queryUpdate) {
- if (queryUpdate.hasOwnProperty(i)) {
- query[i] = queryUpdate[i] || undefined; //falsey values shall be removed.
- }
- }
- }
- this.context.router.replace({pathname, query});
- },
- getQuery: function () {
- // 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);
- }
-};
-
export var Splitter = React.createClass({
getDefaultProps: function () {
return {
@@ -143,4 +117,4 @@ export const ToggleComponent = (props) =>
ToggleComponent.propTypes = {
name: React.PropTypes.string.isRequired,
onToggleChanged: React.PropTypes.func.isRequired
-} \ No newline at end of file
+}