Skip to content

Commit

Permalink
add path to node context menu #1667
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivan Oskan committed Apr 19, 2021
1 parent 1c2e91e commit b4c8be7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/)

- Hints for Global Settings ([#1715](https://github.com/MaibornWolff/codecharta/issues/1715))
- Indicate total nodes and excluded / flattened nodes in file explorer ([#1880](https://github.com/MaibornWolff/codecharta/issues/1880))
- Add path to node context menu ([#1667](https://github.com/MaibornWolff/codecharta/issues/1667))

### Fixed 🐞

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
</div>

<div class="button-group">
<md-button ng-disabled="true">Node</md-button>
<md-button ng-disabled="true">
<span title="{{ $ctrl._viewModel.nodePath }}">{{ $ctrl._viewModel.lastPartOfNodePath }}</span>
</md-button>
<md-button
ng-show="!$ctrl.isNodeFocused()"
ng-click="$ctrl.focusNode()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ export class NodeContextMenuController
codeMapNode: CodeMapNode
showNodeContextMenu: boolean
markingColors: string[]
nodePath: string
lastPartOfNodePath: string
} = {
codeMapNode: null,
showNodeContextMenu: false,
markingColors: null
markingColors: null,
nodePath: "",
lastPartOfNodePath: ""
}

/* @ngInject */
Expand Down Expand Up @@ -67,6 +71,9 @@ export class NodeContextMenuController

onShowNodeContextMenu(path: string, nodeType: string, mouseX: number, mouseY: number) {
this._viewModel.codeMapNode = getCodeMapNodeFromPath(path, nodeType, this.codeMapPreRenderService.getRenderMap())
this._viewModel.nodePath = path
this._viewModel.lastPartOfNodePath =
path.lastIndexOf("/") === 0 ? path.slice(path.lastIndexOf("/")) : `...${path.slice(path.lastIndexOf("/"))}`
this._viewModel.showNodeContextMenu = true

const { x, y } = this.calculatePosition(mouseX, mouseY)
Expand Down

0 comments on commit b4c8be7

Please sign in to comment.