Bug 1944506 - Add Remove condition and Remove log items to the debugger gutter breakpoint context menu. r?bomsy
This commit is contained in:
1 parent
400ba3fb5e
commit
628fd9f94d
3 files changed
+80
No files matched your search
@@ -76,7 +76,13 @@ export function showEditorEditBreakpointContextMenu(event, breakpoint) {
|
||||
items.push(
|
||||
conditionalBreakpointItem(breakpoint, selectedLocation, dispatch)
|
||||
);
|
||||
if (breakpoint.options.condition) {
|
||||
items.push(removeConditionItem(breakpoint, selectedLocation, dispatch));
|
||||
}
|
||||
items.push(logPointItem(breakpoint, selectedLocation, dispatch));
|
||||
if (breakpoint.options.logValue) {
|
||||
items.push(removeLogPointItem(breakpoint, selectedLocation, dispatch));
|
||||
}
|
||||
|
||||
showMenu(event, items, { accesskeyConflictsBug: 2073896 });
|
||||
};
|
||||
@@ -159,6 +165,20 @@ const conditionalBreakpointItem = (breakpoint, location, dispatch) => {
|
||||
: addConditionalBreakpointItem(location, dispatch);
|
||||
};
|
||||
|
||||
const removeConditionItem = (breakpoint, location, dispatch) => ({
|
||||
id: "node-menu-remove-condition",
|
||||
label: L10N.getStr("breakpointMenuItem.removeCondition2.label"),
|
||||
accesskey: L10N.getStr("breakpointMenuItem.removeCondition2.accesskey"),
|
||||
disabled: false,
|
||||
click: () =>
|
||||
dispatch(
|
||||
setBreakpointOptions(location, {
|
||||
...breakpoint.options,
|
||||
condition: null,
|
||||
})
|
||||
),
|
||||
});
|
||||
|
||||
const addLogPointItem = (location, dispatch) => ({
|
||||
id: "node-menu-add-log-point",
|
||||
label: L10N.getStr("editor.addLogPoint"),
|
||||
@@ -190,6 +210,20 @@ const logPointItem = (breakpoint, location, dispatch) => {
|
||||
: addLogPointItem(location, dispatch);
|
||||
};
|
||||
|
||||
const removeLogPointItem = (breakpoint, location, dispatch) => ({
|
||||
id: "node-menu-remove-log",
|
||||
label: L10N.getStr("editor.removeLogPoint.label"),
|
||||
accesskey: L10N.getStr("editor.removeLogPoint.accesskey"),
|
||||
disabled: false,
|
||||
click: () =>
|
||||
dispatch(
|
||||
setBreakpointOptions(location, {
|
||||
...breakpoint.options,
|
||||
logValue: null,
|
||||
})
|
||||
),
|
||||
});
|
||||
|
||||
const toggleDisabledBreakpointItem = (
|
||||
breakpoint,
|
||||
blackboxedRangesForSelectedSource,
|
||||
|
||||
Reference in new issue
Block a user