forked from firefox-devtools/debugger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.js
More file actions
113 lines (98 loc) · 2.25 KB
/
ui.js
File metadata and controls
113 lines (98 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// @flow
import { getSource, getActiveSearch } from "../selectors";
import type { ThunkArgs } from "./types";
import type { ActiveSearchType, OrientationType } from "../reducers/ui";
export function setContextMenu(type: string, event: any) {
return ({ dispatch }: ThunkArgs) => {
dispatch({ type: "SET_CONTEXT_MENU", contextMenu: { type, event } });
};
}
export function closeActiveSearch() {
return {
type: "TOGGLE_ACTIVE_SEARCH",
value: null
};
}
export function setActiveSearch(activeSearch?: ActiveSearchType) {
return ({ dispatch, getState }: ThunkArgs) => {
const activeSearchState = getActiveSearch(getState());
if (activeSearchState === activeSearch) {
return;
}
dispatch({
type: "TOGGLE_ACTIVE_SEARCH",
value: activeSearch
});
};
}
export function toggleFrameworkGrouping(toggleValue: boolean) {
return ({ dispatch, getState }: ThunkArgs) => {
dispatch({
type: "TOGGLE_FRAMEWORK_GROUPING",
value: toggleValue
});
};
}
export function showSource(sourceId: string) {
return ({ dispatch, getState }: ThunkArgs) => {
const source = getSource(getState(), sourceId);
dispatch({
type: "SHOW_SOURCE",
sourceUrl: ""
});
dispatch({
type: "SHOW_SOURCE",
sourceUrl: source.get("url")
});
};
}
export function togglePaneCollapse(position: string, paneCollapsed: boolean) {
return {
type: "TOGGLE_PANE",
position,
paneCollapsed
};
}
/**
* @memberof actions/sources
* @static
*/
export function highlightLineRange(location: {
start: number,
end: number,
sourceId: number
}) {
return {
type: "HIGHLIGHT_LINES",
location
};
}
/**
* @memberof actions/sources
* @static
*/
export function clearHighlightLineRange() {
return {
type: "CLEAR_HIGHLIGHT_LINES"
};
}
export function openConditionalPanel(line?: number) {
return {
type: "OPEN_CONDITIONAL_PANEL",
line: line
};
}
export function closeConditionalPanel() {
return {
type: "CLOSE_CONDITIONAL_PANEL"
};
}
export function setProjectDirectoryRoot(url: Object) {
return {
type: "SET_PROJECT_DIRECTORY_ROOT",
url
};
}
export function setOrientation(orientation: OrientationType) {
return { type: "SET_ORIENTATION", orientation };
}