Skip to content

Commit

Permalink
fix(contextManager): default tool after context change
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbeau committed May 11, 2020
1 parent b85c688 commit 79a1239
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 3 additions & 5 deletions src/app/pages/portal/portal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,13 @@ export class PortalComponent implements OnInit, OnDestroy {
const contextManagerOptions = contextManager
? contextManager.options
: {};
let toolToOpen = contextManagerOptions.toolToOpenOnContextChange
? contextManagerOptions.toolToOpenOnContextChange
: undefined;
let toolToOpen = contextManagerOptions.toolToOpenOnContextChange;

if (!toolToOpen) {
const toolOrderToOpen = ['mapTools', 'map', 'mapDetails', 'mapLegend'];
for (const toolName of toolOrderToOpen) {
toolToOpen = this.toolbox.getTool(toolName);
if (toolToOpen) {
if (this.toolbox.getTool(toolName)) {
toolToOpen = toolName;
break;
}
}
Expand Down
8 changes: 1 addition & 7 deletions src/contexts/_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,11 @@
}
},
{
"name": "contextManager",
"options": {
"toolToOpenOnContextChange": "mapTools"
}
"name": "contextManager"
},
{
"name": "about"
},
{
"name": "map"
},
{
"name": "mapTools",
"options": {
Expand Down

0 comments on commit 79a1239

Please sign in to comment.