mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 10:11:03 +00:00
Merge pull request #1960 from weaveworks/1325-close-help-dialog
Close help dialog when the canvas is clicked
This commit is contained in:
@@ -463,4 +463,9 @@ describe('RootReducer', () => {
|
||||
expect(nextState.get('nodeDetails').size).toEqual(1);
|
||||
expect(nextState.get('currentTopology').get('name')).toBe('Topo2');
|
||||
});
|
||||
it('closes the help dialog if the canvas is clicked', () => {
|
||||
let nextState = initialState.set('showingHelp', true);
|
||||
nextState = reducer(nextState, { type: ActionTypes.CLICK_BACKGROUND });
|
||||
expect(nextState.get('showingHelp')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -186,6 +186,9 @@ export function rootReducer(state = initialState, action) {
|
||||
}
|
||||
|
||||
case ActionTypes.CLICK_BACKGROUND: {
|
||||
if (state.get('showingHelp')) {
|
||||
state = state.set('showingHelp', false);
|
||||
}
|
||||
return closeAllNodeDetails(state);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user