Add action to open reusabel context menu
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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]?.();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user