Skip to content

Commit

Permalink
Added get, set for private _sidebarOpened variable in Data Service, a…
Browse files Browse the repository at this point in the history
…nd updated function of search icon in toolbar
  • Loading branch information
iguannalin committed May 7, 2021
1 parent e77c625 commit 9cbc6f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion nav-app/src/app/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ export class DataService {
public versions: any[] = [];

public subtechniquesEnabled: boolean = true;
public sidebarOpened: boolean = false;
public versionChangelog?: VersionChangelog<Technique>;

private _sidebarOpened = true;
public get sidebarOpened(): boolean { return this._sidebarOpened };
public set sidebarOpened(newVal: boolean) { this._sidebarOpened = newVal };

/**
* Callback functions passed to this function will be called after data is loaded
* @param {*} callback callback function to call when data is done loading
Expand Down
2 changes: 1 addition & 1 deletion nav-app/src/app/datatable/data-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<div *ngIf="configService.getFeature('search')" class="control-row-item">

<div class="control-row-button dropdown noselect"
(click)="currentDropdown = currentDropdown !== 'search' ? 'search' : null;"
(click)="sidebarOpened = !sidebarOpened"
matTooltipPosition="below"
matTooltip="search">
<img src="assets/icons/ic_search_black_24px.svg"/>
Expand Down
2 changes: 1 addition & 1 deletion nav-app/src/app/datatable/data-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class DataTableComponent implements AfterViewInit {

currentDropdown: string = ""; //current dropdown menu

public get sidebarOpened() { return this.dataService.sidebarOpened; }
sidebarOpened = this.dataService.sidebarOpened;


//////////////////////////////////////////////////////////
Expand Down

0 comments on commit 9cbc6f0

Please sign in to comment.