mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-19 21:39:26 +00:00
Fixed contrast mode in the URL.
This commit is contained in:
@@ -699,11 +699,12 @@ export function receiveNotFound(nodeId, requestTimestamp) {
|
||||
}
|
||||
|
||||
export function setContrastMode(enabled) {
|
||||
return (dispatch) => {
|
||||
return (dispatch, getState) => {
|
||||
dispatch({
|
||||
enabled,
|
||||
type: ActionTypes.TOGGLE_CONTRAST_MODE,
|
||||
});
|
||||
updateRoute(getState);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -13,19 +13,12 @@ import {
|
||||
|
||||
|
||||
class Footer extends React.Component {
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
|
||||
this.handleContrastClick = this.handleContrastClick.bind(this);
|
||||
this.handleRelayoutClick = this.handleRelayoutClick.bind(this);
|
||||
}
|
||||
|
||||
handleContrastClick(ev) {
|
||||
handleContrastClick = (ev) => {
|
||||
ev.preventDefault();
|
||||
this.props.setContrastMode(!this.props.contrastMode);
|
||||
}
|
||||
|
||||
handleRelayoutClick(ev) {
|
||||
handleRelayoutClick = (ev) => {
|
||||
ev.preventDefault();
|
||||
trackAnalyticsEvent('scope.layout.refresh.click', {
|
||||
layout: this.props.topologyViewMode,
|
||||
|
||||
@@ -692,6 +692,9 @@ export function rootReducer(state = initialState, action) {
|
||||
if (action.state.gridSortedDesc !== undefined) {
|
||||
state = state.set('gridSortedDesc', action.state.gridSortedDesc);
|
||||
}
|
||||
if (action.state.contrastMode !== undefined) {
|
||||
state = state.set('contrastMode', action.state.contrastMode);
|
||||
}
|
||||
if (action.state.showingNetworks) {
|
||||
state = state.set('showingNetworks', action.state.showingNetworks);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user