diff --git a/src/client/action/navigation.js b/src/client/action/navigation.js index 02ee13a..d61ea0b 100644 --- a/src/client/action/navigation.js +++ b/src/client/action/navigation.js @@ -110,3 +110,12 @@ export function openSearch(term) { term, }); } + +export function openReusableContextMenu(placement, cords, render) { + appDispatcher.dispatch({ + type: cons.actions.navigation.OPEN_REUSABLE_CONTEXT_MENU, + placement, + cords, + render, + }); +} diff --git a/src/client/state/cons.js b/src/client/state/cons.js index 84359a8..aa49f15 100644 --- a/src/client/state/cons.js +++ b/src/client/state/cons.js @@ -42,6 +42,7 @@ const cons = { OPEN_ROOMOPTIONS: 'OPEN_ROOMOPTIONS', CLICK_REPLY_TO: 'CLICK_REPLY_TO', OPEN_SEARCH: 'OPEN_SEARCH', + OPEN_REUSABLE_CONTEXT_MENU: 'OPEN_REUSABLE_CONTEXT_MENU', }, room: { JOIN: 'JOIN', @@ -78,6 +79,7 @@ const cons = { ROOMOPTIONS_OPENED: 'ROOMOPTIONS_OPENED', REPLY_TO_CLICKED: 'REPLY_TO_CLICKED', SEARCH_OPENED: 'SEARCH_OPENED', + REUSABLE_CONTEXT_MENU_OPENED: 'REUSABLE_CONTEXT_MENU_OPENED', }, roomList: { ROOMLIST_UPDATED: 'ROOMLIST_UPDATED', diff --git a/src/client/state/navigation.js b/src/client/state/navigation.js index c8c7b2a..c22035b 100644 --- a/src/client/state/navigation.js +++ b/src/client/state/navigation.js @@ -147,6 +147,14 @@ class Navigation extends EventEmitter { action.term, ); }, + [cons.actions.navigation.OPEN_REUSABLE_CONTEXT_MENU]: () => { + this.emit( + cons.events.navigation.REUSABLE_CONTEXT_MENU_OPENED, + action.placement, + action.cords, + action.render, + ); + }, }; actions[action.type]?.(); }