Added logic to close help dialog when canvas is clicked

This commit is contained in:
jpellizzari
2016-10-27 18:04:38 -07:00
parent ba2158057a
commit 52f7980f6f
2 changed files with 8 additions and 0 deletions

View File

@@ -471,4 +471,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);
});
});

View File

@@ -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);
}