mirror of
https://github.com/simon987/task_tracker.git
synced 2025-04-19 10:16:41 +00:00
Fix pause button
This commit is contained in:
parent
ce5344d9c7
commit
c736cc3d98
@ -64,10 +64,18 @@
|
|||||||
color="primary"
|
color="primary"
|
||||||
(click)="pauseProject()"
|
(click)="pauseProject()"
|
||||||
*ngIf="!project.paused"
|
*ngIf="!project.paused"
|
||||||
[title]="'dashboard.pause_hint'|translate">{{"dashboard.pause"|translate}}</button>
|
[title]="'dashboard.pause_hint'|translate">
|
||||||
<button mat-raised-button color="primary" (click)="pauseProject()">
|
|
||||||
<mat-icon>pause</mat-icon>
|
<mat-icon>pause</mat-icon>
|
||||||
{{"dashboard.pause"|translate}}</button>
|
{{"dashboard.pause"|translate}}
|
||||||
|
</button>
|
||||||
|
<button mat-raised-button
|
||||||
|
color="primary"
|
||||||
|
(click)="resumeProject()"
|
||||||
|
*ngIf="project.paused"
|
||||||
|
[title]="'dashboard.resume_hint'|translate">
|
||||||
|
<mat-icon>play_arrow</mat-icon>
|
||||||
|
{{"dashboard.resume"|translate}}
|
||||||
|
</button>
|
||||||
<button mat-raised-button color="warn" (click)="hardReset()">
|
<button mat-raised-button color="warn" (click)="hardReset()">
|
||||||
<mat-icon>warning</mat-icon>
|
<mat-icon>warning</mat-icon>
|
||||||
{{"dashboard.hard_reset"|translate}}
|
{{"dashboard.hard_reset"|translate}}
|
||||||
|
@ -355,11 +355,19 @@ export class ProjectDashboardComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pauseProject() {
|
pauseProject() {
|
||||||
|
this.setPaused(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
resumeProject() {
|
||||||
|
this.setPaused(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
private setPaused(paused: boolean) {
|
||||||
this.dialog.open(AreYouSureComponent, {
|
this.dialog.open(AreYouSureComponent, {
|
||||||
width: '250px',
|
width: '250px',
|
||||||
}).afterClosed().subscribe(result => {
|
}).afterClosed().subscribe(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.project.paused = true;
|
this.project.paused = paused;
|
||||||
this.apiService.updateProject(this.project).subscribe(() => {
|
this.apiService.updateProject(this.project).subscribe(() => {
|
||||||
this.translate.get("messenger.acknowledged").subscribe(t =>
|
this.translate.get("messenger.acknowledged").subscribe(t =>
|
||||||
this.messenger.show(t))
|
this.messenger.show(t))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user