Skip to content

Commit 4fc0b02

Browse files
committed
1 parent 6d5bf6d commit 4fc0b02

File tree

3 files changed

+291
-170
lines changed

3 files changed

+291
-170
lines changed

src/shared/actions/topcoder_header.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,28 @@ import { createActions } from 'redux-actions';
99
* Payload creator for OPEN_MENU action.
1010
* @param {Object} menu Menu to open.
1111
* @param {Object} triggerNode HTML node which has triggered the action.
12+
* @param {Boolean} triggerByTouch whether this action is triggered by touch event.
1213
* We gonna store to the state its on-screen layout position, so that
1314
* when mouse cursor moves back and forth between that node and the
1415
* opened menu, we can check it and keep the menu open.
1516
*/
16-
function openMenu(menu, triggerNode) {
17+
function openMenu(menu, triggerNode, triggerByTouch) {
1718
return ({
1819
menu,
20+
node: triggerNode.dataset.menu,
1921
trigger: _.toPlainObject(triggerNode.getBoundingClientRect()),
22+
isMobile: triggerByTouch,
2023
});
2124
}
2225

2326
/**
2427
* Payload creator for OPEN_SEARCH action.
2528
* @param {Object} triggerNode HTML node which has triggered the action.
29+
* @param {Boolean} triggerByTouch whether this action is triggered by touch event.
2630
* This serves the same purpose as in openMenu() function.
2731
*/
28-
function openSearch(triggerNode) {
29-
return openMenu(undefined, triggerNode);
32+
function openSearch(triggerNode, triggerByTouch) {
33+
return openMenu(undefined, triggerNode, triggerByTouch);
3034
}
3135

3236
/**

0 commit comments

Comments
 (0)