add edit json v1 WIP, testing
This commit is contained in:
parent
e5eee656d5
commit
ea92145350
11 changed files with 216 additions and 67 deletions
|
|
@ -182,6 +182,14 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
message: 'Do you want to save changes?',
|
||||
confirmCallBack: () => {
|
||||
console.log('confirm save');
|
||||
// TODO: update value in targeted recipe
|
||||
this._recipeService.editChanges(
|
||||
this._recipeService.getCurrentVersion(),
|
||||
{
|
||||
...this.recipeDetail
|
||||
}
|
||||
);
|
||||
console.log("Sending changes")
|
||||
this._router.navigate(['/recipes']);
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -191,4 +191,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-circle fixed z-100 bottom-5 right-1" (click)="scrollToTop()">^</button>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,12 @@ export class DashboardComponent implements OnInit {
|
|||
private searchStr = '';
|
||||
private oldSearchStr = '';
|
||||
|
||||
tableCtx?: ElementRef;
|
||||
|
||||
@ViewChild('table', { static: false }) set content(table: ElementRef) {
|
||||
// expose element ref for other fn
|
||||
this.tableCtx = table;
|
||||
|
||||
table.nativeElement.addEventListener(
|
||||
'scroll',
|
||||
() => {
|
||||
|
|
@ -202,4 +207,8 @@ export class DashboardComponent implements OnInit {
|
|||
'_blank'
|
||||
);
|
||||
}
|
||||
|
||||
scrollToTop() {
|
||||
this.tableCtx!.nativeElement.scroll;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue