зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1537596 - Make shift-click toggle all breakpoint states per line r=loganfsmyth
Implements a function to enable or disable all breakpoints on a line based on shift-clicking. Uses the first breakpoint's state to decide whether to enable or disable all. Differential Revision: https://phabricator.services.mozilla.com/D24440 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
a936755fa6
Коммит
29407aeed7
|
@ -18,7 +18,8 @@ import {
|
|||
getBreakpointAtLocation,
|
||||
getConditionalPanelLocation,
|
||||
getBreakpointsForSource,
|
||||
isEmptyLineInSource
|
||||
isEmptyLineInSource,
|
||||
getBreakpointsAtLine
|
||||
} from "../../selectors";
|
||||
import {
|
||||
assertBreakpoint,
|
||||
|
@ -208,6 +209,16 @@ export function toggleBreakpoints(
|
|||
};
|
||||
}
|
||||
|
||||
export function toggleBreakpointsAtLine(
|
||||
shouldDisableBreakpoints: boolean,
|
||||
line: number
|
||||
) {
|
||||
return async ({ dispatch, getState }: ThunkArgs) => {
|
||||
const breakpoints = await getBreakpointsAtLine(getState(), line);
|
||||
return dispatch(toggleBreakpoints(shouldDisableBreakpoints, breakpoints));
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all breakpoints
|
||||
*
|
||||
|
|
|
@ -97,6 +97,13 @@ class Breakpoint extends PureComponent<Props> {
|
|||
}
|
||||
|
||||
if (event.shiftKey) {
|
||||
if (features.columnBreakpoints) {
|
||||
return breakpointActions.toggleBreakpointsAtLine(
|
||||
!breakpoint.disabled,
|
||||
this.selectedLocation.line
|
||||
);
|
||||
}
|
||||
|
||||
return breakpointActions.toggleDisabledBreakpoint(breakpoint);
|
||||
}
|
||||
|
||||
|
|
|
@ -228,6 +228,7 @@ export function breakpointItemActions(dispatch: Function) {
|
|||
disableBreakpointsAtLine: actions.disableBreakpointsAtLine,
|
||||
disableBreakpoint: actions.disableBreakpoint,
|
||||
toggleDisabledBreakpoint: actions.toggleDisabledBreakpoint,
|
||||
toggleBreakpointsAtLine: actions.toggleBreakpointsAtLine,
|
||||
openConditionalPanel: actions.openConditionalPanel
|
||||
},
|
||||
dispatch
|
||||
|
|
Загрузка…
Ссылка в новой задаче