aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/ducks
diff options
context:
space:
mode:
authorJason <jason.daurus@gmail.com>2016-07-05 13:57:32 -0400
committerJason <jason.daurus@gmail.com>2016-07-05 13:57:32 -0400
commit09ab2528f5c2753d6d951787fc23600944cb467d (patch)
tree7a318df92ae6927aecda875d850a2f5ebfd0aa6b /web/src/js/ducks
parent7b543dd95c2732be2e704400d9ed04c20d795b56 (diff)
parentdb991e2bccc10e8e31fb200cba2a99bf94e83914 (diff)
downloadmitmproxy-09ab2528f5c2753d6d951787fc23600944cb467d.tar.gz
mitmproxy-09ab2528f5c2753d6d951787fc23600944cb467d.tar.bz2
mitmproxy-09ab2528f5c2753d6d951787fc23600944cb467d.zip
[web] bug fixs
Diffstat (limited to 'web/src/js/ducks')
-rw-r--r--web/src/js/ducks/ui.js38
1 files changed, 30 insertions, 8 deletions
diff --git a/web/src/js/ducks/ui.js b/web/src/js/ducks/ui.js
index bc64ffa8..15334f88 100644
--- a/web/src/js/ducks/ui.js
+++ b/web/src/js/ducks/ui.js
@@ -4,15 +4,17 @@ import * as flowsActions from '../ducks/flows'
export const SET_ACTIVE_MENU = 'UI_SET_ACTIVE_MENU'
export const SET_CONTENT_VIEW = 'UI_SET_CONTENT_VIEW'
-export const SET_SELECTED_INPUT = 'SET_SELECTED_INPUT'
-export const UPDATE_QUERY = 'UPDATE_QUERY'
-export const SELECT_TAB = 'SELECT_TAB'
-export const SELECT_TAB_RELATIVE = 'SELECT_TAB_RELATIVE'
-export const SET_PROMPT = 'SET_PROMPT'
+export const SET_SELECTED_INPUT = 'UI_SET_SELECTED_INPUT'
+export const UPDATE_QUERY = 'UI_UPDATE_QUERY'
+export const SELECT_TAB = 'UI_SELECT_TAB'
+export const SELECT_TAB_RELATIVE = 'UI_SELECT_TAB_RELATIVE'
+export const SET_PROMPT = 'UI_SET_PROMPT'
+export const SET_DISPLAY_LARGE = 'UI_SET_DISPLAY_LARGE'
const defaultState = {
activeMenu: 'Start',
selectedInput: null,
+ displayLarge: false,
promptOpen: false,
contentView: 'ViewAuto',
query: {},
@@ -32,6 +34,7 @@ export default function reducer(state = defaultState, action) {
if (action.flowId && !action.currentSelection) {
return {
...state,
+ displayLarge: false,
activeMenu: 'Flow',
}
}
@@ -39,11 +42,15 @@ export default function reducer(state = defaultState, action) {
if (!action.flowId && state.activeMenu === 'Flow') {
return {
...state,
+ displayLarge: false,
activeMenu: 'Start',
}
}
- return state
+ return {
+ ...state,
+ displayLarge: false,
+ }
case SET_CONTENT_VIEW:
return {
@@ -88,6 +95,12 @@ export default function reducer(state = defaultState, action) {
promptOpen: action.open,
}
+ case SET_DISPLAY_LARGE:
+ return {
+ ...state,
+ displayLarge: action.displayLarge,
+ }
+
default:
return state
}
@@ -124,7 +137,17 @@ export function setPrompt(open) {
return { type: SET_PROMPT, open }
}
-export function onKeyDown(key, shiftKey) {
+export function setDisplayLarge(displayLarge) {
+ return { type: SET_DISPLAY_LARGE, displayLarge }
+}
+
+export function onKeyDown(e) {
+ if(e.ctrlKey) {
+ return () => {}
+ }
+ var key = e.keyCode
+ var shiftKey = e.shiftKey
+ e.preventDefault()
return (dispatch, getState) => {
switch (key) {
@@ -235,6 +258,5 @@ export function onKeyDown(key, shiftKey) {
default:
return () => {}
}
- event.preventDefault()
}
}