diff options
author | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-04-27 18:20:22 +0530 |
---|---|---|
committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-04-27 18:20:22 +0530 |
commit | 7a51214ef9b5b387c614b0139987a2c94d49b902 (patch) | |
tree | af148c045205d5f165336c69ff3295fa0c699ada /src/client/views/ContextMenu.tsx | |
parent | 20beef06518bfa08db60b8c5a06c637dab0f2b92 (diff) | |
parent | 0dfe3d9f0790f499b380cbafcef40cfbe0c7ad29 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into grid_view_secondary
Diffstat (limited to 'src/client/views/ContextMenu.tsx')
-rw-r--r-- | src/client/views/ContextMenu.tsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/views/ContextMenu.tsx b/src/client/views/ContextMenu.tsx index 4d04d4e89..5b66b63ed 100644 --- a/src/client/views/ContextMenu.tsx +++ b/src/client/views/ContextMenu.tsx @@ -99,6 +99,15 @@ export class ContextMenu extends React.Component { } } @action + moveAfter(item: ContextMenuProps, after: ContextMenuProps) { + if (this.findByDescription(after.description)) { + const curInd = this._items.findIndex((i) => i.description === item.description); + this._items.splice(curInd, 1); + const afterInd = this._items.findIndex((i) => i.description === after.description); + this._items.splice(afterInd + 1, 0, item); + } + } + @action setDefaultItem(prefix: string, item: (name: string) => void) { this._defaultPrefix = prefix; this._defaultItem = item; |